xref: /PHP-7.2/ext/oci8/tests/bug47189.phpt (revision a2c0f872)
1--TEST--
2Bug #47189 (Multiple oci_fetch_all calls)
3--SKIPIF--
4<?php
5$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs: different error handling for this undefined behavior
6require(dirname(__FILE__).'/skipif.inc');
7?>
8--FILE--
9<?php
10
11require(dirname(__FILE__).'/connect.inc');
12
13echo "Test 1\n";
14
15$s = oci_parse($c, "select * from dual");
16oci_execute($s);
17oci_fetch_all($s, $rs, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
18var_dump($rs);
19oci_fetch_all($s, $rs1, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
20var_dump($rs1);
21
22echo "Test 2\n";
23
24$s = oci_parse($c, "select * from dual");
25oci_execute($s);
26oci_fetch_all($s, $rs, 0, 1, OCI_FETCHSTATEMENT_BY_ROW);
27var_dump($rs);
28oci_fetch_all($s, $rs1, 0, 1, OCI_FETCHSTATEMENT_BY_ROW);
29var_dump($rs1);
30
31?>
32===DONE===
33<?php exit(0); ?>
34--EXPECTF--
35Test 1
36array(1) {
37  [0]=>
38  array(1) {
39    ["DUMMY"]=>
40    string(1) "X"
41  }
42}
43array(0) {
44}
45Test 2
46array(1) {
47  [0]=>
48  array(1) {
49    ["DUMMY"]=>
50    string(1) "X"
51  }
52}
53
54Warning: oci_fetch_all(): ORA-01002: %s in %s on line %d
55array(0) {
56}
57===DONE===
58