From 3da36d58dc318806a4f016f5aacbaff3059ec343 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Fri, 29 May 2009 11:59:09 +0000 Subject: [PATCH] 'Fixing' test to reflect a libmysql vs. mysqlnd difference. With libmysql it is not defined what mysql_stmt_store_result() shall return when one tries to store the (non-existing) result set of a failed SQL statement, http://dev.mysql.com/doc/refman/6.0/en/mysql-stmt-store-result.html . mysqlnd will detect the SQL failure and return false. libmysql will return true. If you want libmysql to change, file a bug report at MySQL... I don't think there is a good way to work around this in the extension itself. --- ext/mysqli/tests/mysqli_stmt_affected_rows.phpt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt index 4e69428e3e..7059608ccf 100644 --- a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt @@ -211,8 +211,13 @@ require_once('skipifconnectfailure.inc'); if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt))) printf("[042] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = mysqli_stmt_store_result($stmt))) - printf("[043] Expecting boolean/false, got %s\%s\n", gettype($tmp), $tmp); + if ($IS_MYSQLND) { + if (false !== ($tmp = mysqli_stmt_store_result($stmt))) + printf("[043] Expecting boolean/false, got %s\%s\n", gettype($tmp), $tmp); + } else { + if (true !== ($tmp = mysqli_stmt_store_result($stmt))) + printf("[043] Libmysql does not care if the previous statement was bogus, expecting boolean/true, got %s\%s\n", gettype($tmp), $tmp); + } if (0 !== ($tmp = mysqli_stmt_num_rows($stmt))) printf("[044] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp); -- 2.50.1