Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / oci8 / tests / bug42496_2.phpt
blob71854f3d46abf875833b5fcf58c8723ef1cf52bd
1 --TEST--
2 Bug #42496 (LOB fetch leaks cursors, eventually failing with ORA-1000 maximum open cursors reached)
3 --SKIPIF--
4 <?php
5 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
6 require(dirname(__FILE__).'/skipif.inc');
7 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
8 ?> 
9 --FILE--
10 <?php
12 require dirname(__FILE__).'/connect.inc';
14 // Initialization
16 $stmtarray = array(
17         "DROP table bug42496_2_tab",
18         "CREATE table bug42496_2_tab(c1 CLOB, c2 CLOB)",
19         "INSERT INTO bug42496_2_tab VALUES('test1', 'test1')",
20         "INSERT INTO bug42496_2_tab VALUES('test2', 'test2')",
21         "INSERT INTO bug42496_2_tab VALUES('test3', 'test3')"
24 oci8_test_sql_execute($c, $stmtarray);
26 // Run Test
28 echo "Test 2\n";
30 for ($i = 0; $i < 15000; $i++) {
31         $s = oci_parse($c, "SELECT * from bug42496_2_tab");
32         if (oci_execute($s)) {
33                 $arr = array();
34                 while ($arr = oci_fetch_assoc($s)) {
35                         $arr['C1']->free();
36                         $arr['C2']->free();
37                 }
38         }
39         oci_free_statement($s);
42 echo "Done\n";
44 // Cleanup
46 $stmtarray = array(
47         "DROP table bug42496_2_tab"
50 oci8_test_sql_execute($c, $stmtarray);
53 --EXPECTF--
54 Test 2
55 Done