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:
Georg Richter 2005-01-28 17:35:37 +00:00
parent 999c63d9d7
commit 32aaa6a7be
2 changed files with 63 additions and 2 deletions

View file

@ -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)
}
/* }}} */