From 990e2612ccb80a09cf08df6ad2bf9c29d057c192 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Thu, 6 Dec 2001 15:04:23 +0000 Subject: Work around a quirk in the MySQL client library to fix unbuffered queries --- ext/mysql/php_mysql.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/mysql/php_mysql.c') diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 8b40ae1a63..12bde868e3 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -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; } -- cgit v1.2.1