summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-10-09 15:14:22 +0000
committerMarcus Boerger <helly@php.net>2005-10-09 15:14:22 +0000
commita8c5828ce077fe821e5c079d6adc5f6916107777 (patch)
treeb7d4b4adc73d55c916bdbcc0caccd9125469bec4 /ext/pgsql/tests
parentde03dd63872d5e24a06691a8fafb5fa39054d81c (diff)
downloadphp-git-a8c5828ce077fe821e5c079d6adc5f6916107777.tar.gz
- MFH Add new test
Diffstat (limited to 'ext/pgsql/tests')
-rwxr-xr-xext/pgsql/tests/80_bug32223.phpt51
1 files changed, 51 insertions, 0 deletions
diff --git a/ext/pgsql/tests/80_bug32223.phpt b/ext/pgsql/tests/80_bug32223.phpt
new file mode 100755
index 0000000000..94d934eb29
--- /dev/null
+++ b/ext/pgsql/tests/80_bug32223.phpt
@@ -0,0 +1,51 @@
+--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($dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
+begin
+ RAISE NOTICE ''11111'';
+ return ''f'';
+end;
+' LANGUAGE plpgsql;");
+
+try
+{
+ $res = pg_query($dbh, 'SELECT test_notice()');
+ $row = pg_fetch_row($res, 0);
+ var_dump($row);
+ pg_free_result($res);
+ if ($row[0] == 'f')
+ {
+ throw new Exception(pg_last_notice($dbh));
+ }
+ echo 2;
+}
+catch (Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+pg_close($dbh);
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(1) "f"
+}
+string(14) "NOTICE: 11111"
+===DONE===