]> granicus.if.org Git - php/commitdiff
New test for oci_fetch_all
authorChristopher Jones <sixd@php.net>
Mon, 9 Mar 2009 21:19:18 +0000 (21:19 +0000)
committerChristopher Jones <sixd@php.net>
Mon, 9 Mar 2009 21:19:18 +0000 (21:19 +0000)
ext/oci8/tests/bug47189.phpt [new file with mode: 0644]

diff --git a/ext/oci8/tests/bug47189.phpt b/ext/oci8/tests/bug47189.phpt
new file mode 100644 (file)
index 0000000..b8623ad
--- /dev/null
@@ -0,0 +1,48 @@
+--TEST--
+Bug #47189 (Multiple oci_fetch_all calls) 
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require(dirname(__FILE__).'/connect.inc');
+
+$s = oci_parse($c, "select * from dual");
+oci_execute($s);
+oci_fetch_all($s, $rs, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
+var_dump($rs);
+oci_fetch_all($s, $rs1, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
+var_dump($rs1); 
+
+$s = oci_parse($c, "select * from dual");
+oci_execute($s);
+oci_fetch_all($s, $rs, 0, 1, OCI_FETCHSTATEMENT_BY_ROW);
+var_dump($rs);
+oci_fetch_all($s, $rs1, 0, 1, OCI_FETCHSTATEMENT_BY_ROW);
+var_dump($rs1); 
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+array(1) {
+  [0]=>
+  array(1) {
+    [u"DUMMY"]=>
+    unicode(1) "X"
+  }
+}
+array(0) {
+}
+array(1) {
+  [0]=>
+  array(1) {
+    [u"DUMMY"]=>
+    unicode(1) "X"
+  }
+}
+
+Warning: oci_fetch_all(): ORA-01002: %s in %s on line %d
+array(0) {
+}
+===DONE===