Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / oci8 / tests / bug36403.phpt
blob53dae694ec8bf74f0fbd64f8c744e0efd4dbafcd
1 --TEST--
2 Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY)
3 --SKIPIF--
4 <?php
5 if (!extension_loaded('oci8')) die ("skip no oci8 extension"); 
6 if (preg_match('/^1[01]\./', oci_client_version()) != 1) {
7     die("skip expected output only valid with Oracle 10g or greater version of client");
9 ?>
10 --FILE--
11 <?php
13 require(dirname(__FILE__).'/connect.inc');
15 // Initialization
17 $stmtarray = array(
18         "drop table bug36403_tab",
19         "create table bug36403_tab (c1 number, col2 number, column3 number, col4 number)"
22 oci8_test_sql_execute($c, $stmtarray);
24 // Run Test
26 echo "Test 1\n";
28 $s = oci_parse($c, "select * from bug36403_tab");
29 oci_execute($s, OCI_DESCRIBE_ONLY);
30 for ($i = oci_num_fields($s); $i > 0; $i--) {
31         echo oci_field_name($s, $i) . "\n";
34 echo "Test 2\n";
36 // Should generate an error: ORA-24338: statement handle not executed
37 // since the statement handle was only described and not executed
38 $row = oci_fetch_array($s);
40 // Clean up
42 $stmtarray = array(
43         "drop table bug36403_tab"
46 oci8_test_sql_execute($c, $stmtarray);
49 ===DONE===
50 <?php exit(0); ?>
51 --EXPECTF--
52 Test 1
53 COL4
54 COLUMN3
55 COL2
57 Test 2
59 Warning: oci_fetch_array(): ORA-%r(24338|01002)%r: %sbug36403.php on line %d
60 ===DONE===