diff options
author | Georg Richter <georg@php.net> | 2005-01-28 17:35:37 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2005-01-28 17:35:37 +0000 |
commit | 32aaa6a7bee6181f2f899afb9b98f4acb4e1f16f (patch) | |
tree | 924def621b5c84c65b275fa94673c97321c1bd03 /ext/mysqli/mysqli_api.c | |
parent | 999c63d9d715ed34cfe0a79084bbb1372764b59a (diff) | |
download | php-git-32aaa6a7bee6181f2f899afb9b98f4acb4e1f16f.tar.gz |
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)
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r-- | ext/mysqli/mysqli_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 132456837a..86354d15df 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -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) } /* }}} */ |