]> granicus.if.org Git - php/commitdiff
No more test failure for libmysql, http://news.php.net/php.internals/55210
authorUlf Wendel <uw@php.net>
Mon, 5 Sep 2011 16:24:40 +0000 (16:24 +0000)
committerUlf Wendel <uw@php.net>
Mon, 5 Sep 2011 16:24:40 +0000 (16:24 +0000)
ext/mysqli/tests/mysqli_stmt_num_rows.phpt

index af81ca4e8ae6f23807d97789d0b14851e1a89877..a1f5e89c7a846e53442397c52648940617b8ff58 100644 (file)
@@ -82,7 +82,17 @@ require_once('skipifconnectfailure.inc');
                        $i++;
                } while (mysqli_stmt_fetch($stmt));
 
-               if (7 !== ($tmp = mysqli_stmt_num_rows($stmt)))
+               /* NOTE to users
+               Behaviour with libmysql is UNDEFINED, see http://news.php.net/php.internals/55210
+               Because it is undefined it is allowed to the mysqlnd DEVELOPER to implement
+               any behaviour they like, including the one checked for in this test.
+               What the test does is cover an implementation detail of the mysqlnd library.
+               This implementation detail may, at any time, change without prior notice.
+               On the contrary, the mysqlnd way is a reasonable one and, maybe, one fine
+               day, after Klingons visited earh, becomes the official one. Meanwhile do
+               not rely on it.
+               */
+               if ($IS_MYSQLND && (7 !== ($tmp = mysqli_stmt_num_rows($stmt))))
                        printf("[54] Expecting int/7, got %s/%s\n", gettype($tmp), $tmp);
 
        } else {