Annotation of embedaddon/php/ext/oci8/tests/bug42496_2.phpt, revision 1.1.1.1

1.1       misho       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
                     11: 
                     12: require dirname(__FILE__).'/connect.inc';
                     13: 
                     14: // Initialization
                     15: 
                     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')"
                     22: );
                     23: 
                     24: oci8_test_sql_execute($c, $stmtarray);
                     25: 
                     26: // Run Test
                     27: 
                     28: echo "Test 2\n";
                     29: 
                     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);
                     40: }
                     41: 
                     42: echo "Done\n";
                     43: 
                     44: // Cleanup
                     45: 
                     46: $stmtarray = array(
                     47:        "DROP table bug42496_2_tab"
                     48: );
                     49: 
                     50: oci8_test_sql_execute($c, $stmtarray);
                     51: 
                     52: ?>
                     53: --EXPECTF--
                     54: Test 2
                     55: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>