]> granicus.if.org Git - php/commitdiff
Coverage for bug#54704, of which I think it is bogus, thus no dedicated test.
authorUlf Wendel <uw@php.net>
Fri, 2 Sep 2011 13:35:17 +0000 (13:35 +0000)
committerUlf Wendel <uw@php.net>
Fri, 2 Sep 2011 13:35:17 +0000 (13:35 +0000)
ext/mysql/tests/mysql_num_rows.phpt

index 1f68b4d609fc2ae2467aaf341bd0230fa1b13ef0..0f538c4a2b16d54225ab21f17f8e950cf453bcb0 100644 (file)
@@ -54,6 +54,23 @@ if ($res = mysql_query('SELECT COUNT(id) AS num FROM test', $link)) {
        printf("[030] [%d] %s\n", mysql_errno($link), mysql_error($link));
 }
 
+if ($res = mysql_unbuffered_query('SELECT id, label FROM test')) {
+
+       if (0 != mysql_num_rows($res))
+               printf("[032] Expecting 0 rows got %d\n", mysql_num_rows($res));
+       
+       $rows = 0;
+       while ($row = mysql_fetch_assoc($res))
+               $rows++;
+
+       if ($rows != mysql_num_rows($res))
+               printf("[033] Expecting %d rows got %d\n", $rows, mysql_num_rows($res));
+
+       mysql_free_result($res);
+} else {
+       printf("[034] [%d] %s\n", mysql_errno($link), mysql_error($link));
+}
+
 mysql_close($link);
 print "done!";
 ?>