diff options
| author | Ulf Wendel <uw@php.net> | 2011-09-02 13:35:17 +0000 |
|---|---|---|
| committer | Ulf Wendel <uw@php.net> | 2011-09-02 13:35:17 +0000 |
| commit | b23baaf0fca5241844c32e87af2c4ec531051c93 (patch) | |
| tree | bba449047e388901a58e72f8b1e79437b2001de8 /ext/mysql/tests | |
| parent | 0c4e2acbe317fa4a2c8c26f75c75f8b54137cf30 (diff) | |
| download | php-git-b23baaf0fca5241844c32e87af2c4ec531051c93.tar.gz | |
Coverage for bug#54704, of which I think it is bogus, thus no dedicated test.
Diffstat (limited to 'ext/mysql/tests')
| -rw-r--r-- | ext/mysql/tests/mysql_num_rows.phpt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/mysql/tests/mysql_num_rows.phpt b/ext/mysql/tests/mysql_num_rows.phpt index 1f68b4d609..0f538c4a2b 100644 --- a/ext/mysql/tests/mysql_num_rows.phpt +++ b/ext/mysql/tests/mysql_num_rows.phpt @@ -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!"; ?> |
