mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
fixed a bug in mysql_affected_rows and mysql_stmt_affected_rows
in case affected_rows function returns (my_ulonglong) -1 for errors. (Thanks to Antony Dovgal for reporting this bug)
This commit is contained in:
parent
999c63d9d7
commit
32aaa6a7be
2 changed files with 63 additions and 2 deletions
|
@ -44,6 +44,9 @@ PHP_FUNCTION(mysqli_affected_rows)
|
|||
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
|
||||
|
||||
rc = mysql_affected_rows(mysql->mysql);
|
||||
if (rc == (my_ulonglong) -1) {
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
MYSQLI_RETURN_LONG_LONG(rc);
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -1445,6 +1448,9 @@ PHP_FUNCTION(mysqli_stmt_affected_rows)
|
|||
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
|
||||
|
||||
rc = mysql_stmt_affected_rows(stmt->stmt);
|
||||
if (rc == (my_ulonglong) -1) {
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
MYSQLI_RETURN_LONG_LONG(rc)
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue