From 222c5b4a9ccbfb878f34be96dcb1bce603f1ef47 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Tue, 6 Sep 2011 19:52:19 +0000 Subject: [PATCH] Fix problems with the unbuffered set detection, for libmysql, which resulted in always true. Thanks Stas. --- ext/mysqli/mysqli_libmysql.h | 4 ++-- ext/mysqli/tests/bug55582.phpt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/mysqli_libmysql.h b/ext/mysqli/mysqli_libmysql.h index 98e18fcfcd..c3f6de583b 100644 --- a/ext/mysqli/mysqli_libmysql.h +++ b/ext/mysqli/mysqli_libmysql.h @@ -29,8 +29,8 @@ #define MYSQLND_OPT_INT_AND_YEAR_AS_INT 201 /* r->data should be always NULL, at least in recent libmysql versions, the status changes once data is read*/ -#define mysqli_result_is_unbuffered(r) (((r)->handle && (r)->handle->status == MYSQL_STATUS_USE_RESULT) || ((r)->data == NULL)) -#define mysqli_result_is_unbuffered_and_not_everything_is_fetched(r) (((r)->handle && (r)->handle->status == MYSQL_STATUS_USE_RESULT) || ((r)->data == NULL)) +#define mysqli_result_is_unbuffered(r) ((r)->handle && (r)->handle->status == MYSQL_STATUS_USE_RESULT && (r)->data == NULL) +#define mysqli_result_is_unbuffered_and_not_everything_is_fetched(r) mysqli_result_is_unbuffered(r) #define mysqli_server_status(c) (c)->server_status #define mysqli_stmt_get_id(s) ((s)->stmt_id) #define mysqli_stmt_warning_count(s) mysql_warning_count((s)->mysql) diff --git a/ext/mysqli/tests/bug55582.phpt b/ext/mysqli/tests/bug55582.phpt index 5b38f3f803..3933845147 100644 --- a/ext/mysqli/tests/bug55582.phpt +++ b/ext/mysqli/tests/bug55582.phpt @@ -5,7 +5,6 @@ Bug #55582 mysqli_num_rows() returns always 0 for unbuffered, when mysqlnd is us require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once("connect.inc"); -if(!$IS_MYSQLND) die("skip This bug is for mysqlnd only"); ?> --FILE--