Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / oci8 / tests / bug44008.phpt
blobfaacdc625401c261c12d40b7a69915d4977e6683
1 --TEST--
2 Bug #44008 (Incorrect usage of OCI-Lob->close crashes PHP)
3 --SKIPIF--
4 <?php
5 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
6 require(dirname(__FILE__).'/skipif.inc');
7 ?> 
8 --FILE--
9 <?php
11 require dirname(__FILE__).'/connect.inc';
13 // Initialization
15 $stmtarray = array(
16                 "create or replace procedure bug44008_proc (p in out clob)
17                 as begin p := 'A';
18                 end;"
21 oci8_test_sql_execute($c, $stmtarray);
23 // Run Test
25 $s = oci_parse($c, 'begin bug44008_proc(:data); end;');
26 $textLob = oci_new_descriptor($c, OCI_D_LOB);
27 oci_bind_by_name($s, ":data", $textLob, -1, OCI_B_CLOB);
28 oci_execute($s, OCI_DEFAULT);
29 $r = $textLob->load();
30 echo "$r\n";
32 // Incorrectly closing the lob doesn't cause a crash.
33 // OCI-LOB->close() is documented for use only with OCI-Lob->writeTemporary()
34 $textLob->close();
36 // Cleanup
38 $stmtarray = array(
39         "drop procedure bug44008_proc"
42 oci8_test_sql_execute($c, $stmtarray);
44 echo "Done\n";
47 --EXPECT--
49 Done