uw              Fri May 29 11:59:09 2009 UTC

  Modified files:              
    /php-src/ext/mysqli/tests   mysqli_stmt_affected_rows.phpt 
  Log:
  '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.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt
diff -u php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt:1.6 
php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt:1.7
--- php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt:1.6 Thu May 28 
15:47:08 2009
+++ php-src/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt     Fri May 29 
11:59:09 2009
@@ -211,8 +211,13 @@
        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);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to