diff options
| author | Marcus Boerger <helly@php.net> | 2004-03-15 19:47:18 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-03-15 19:47:18 +0000 |
| commit | 0ace9f4885d261b14a0492124c9aa4939abd7f5f (patch) | |
| tree | 2a88b33fe6a01aa522d61269c52054e6a42f11cf /ext/pgsql/tests | |
| parent | 05158095cea53cb2d18de617bf8fc80132a1b277 (diff) | |
| download | php-git-0ace9f4885d261b14a0492124c9aa4939abd7f5f.tar.gz | |
Bugfix #27597 pg_fetch_array not returning false .
Diffstat (limited to 'ext/pgsql/tests')
| -rwxr-xr-x | ext/pgsql/tests/80_bug27597.phpt | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ext/pgsql/tests/80_bug27597.phpt b/ext/pgsql/tests/80_bug27597.phpt new file mode 100755 index 0000000000..aa04a4a225 --- /dev/null +++ b/ext/pgsql/tests/80_bug27597.phpt @@ -0,0 +1,60 @@ +--TEST-- +Bug #27597 pg_fetch_array not returning false +--SKIPIF-- +<?php +require_once('skipif.inc'); +?> +--FILE-- +<?php + +require_once('config.inc'); + +$dbh = @pg_connect($conn_str); +if (!$dbh) { + die ("Could not connect to the server"); +} + +@pg_query("DROP TABLE id"); +pg_query("CREATE TABLE id (id INT)"); + +for ($i=0; $i<4; $i++) { + pg_query("INSERT INTO id (id) VALUES ($i)"); +} + +function xi_fetch_array($res, $type = PGSQL_ASSOC) { + $a = pg_fetch_array($res, NULL, $type) ; + return $a ; +} + +$res = pg_query("SELECT * FROM id"); +$i = 0; // endless-loop protection +while($row = xi_fetch_array($res)) { + print_r($row); + if ($i++ > 4) { + echo "ENDLESS-LOOP"; + exit(1); + } +} + +pg_close($dbh); + +?> +===DONE=== +--EXPECTF-- +Array +( + [id] => 0 +) +Array +( + [id] => 1 +) +Array +( + [id] => 2 +) +Array +( + [id] => 3 +) +===DONE=== |
