From ac90fb42875ac1f1cfa2d6ecc2cebab414dc9df9 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Mon, 5 Sep 2011 16:24:40 +0000 Subject: [PATCH] No more test failure for libmysql, http://news.php.net/php.internals/55210 --- ext/mysqli/tests/mysqli_stmt_num_rows.phpt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ext/mysqli/tests/mysqli_stmt_num_rows.phpt b/ext/mysqli/tests/mysqli_stmt_num_rows.phpt index af81ca4e8a..a1f5e89c7a 100644 --- a/ext/mysqli/tests/mysqli_stmt_num_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_num_rows.phpt @@ -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 { -- 2.50.1