mirror of
https://github.com/php/php-src.git
synced 2025-01-20 18:53:37 +08:00
Work around a quirk in the MySQL client library to fix unbuffered queries
This commit is contained in:
parent
a702dc02f9
commit
990e2612cc
@ -1004,10 +1004,12 @@ static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link
|
||||
MYSQL_RES *mysql_result;
|
||||
|
||||
mysql_result = (MYSQL_RES *) zend_list_find(mysql->active_result_id, &type);
|
||||
if (mysql_result && type==le_result && !mysql_eof(mysql_result)) {
|
||||
php_error(E_NOTICE, "Called %s() without first fetching all rows from a previous unbuffered query",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
while (mysql_fetch_row(mysql_result));
|
||||
if (mysql_result && type==le_result) {
|
||||
if (!mysql_eof(mysql_result)) {
|
||||
php_error(E_NOTICE, "Called %s() without first fetching all rows from a previous unbuffered query",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
while (mysql_fetch_row(mysql_result));
|
||||
}
|
||||
zend_list_delete(mysql->active_result_id);
|
||||
mysql->active_result_id = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user