From: Ulf Wendel Date: Fri, 29 May 2009 11:59:26 +0000 (+0000) Subject: MFH - 'Fixing' test to reflect a libmysql vs. mysqlnd difference. With libmysql it... X-Git-Tag: php-5.3.0RC3~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f17909a6022144c5ef6ee6256d6760e3569080d;p=php MFH - '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. --- 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);