Annotation of embedaddon/php/ext/oci8/tests/pecl_bug10194.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) 
        !             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: --INI--
        !            10: memory_limit=10M
        !            11: --FILE--
        !            12: <?php
        !            13:        
        !            14: require dirname(__FILE__).'/connect.inc';
        !            15: require dirname(__FILE__).'/create_table.inc';
        !            16: 
        !            17: $ora_sql = "INSERT INTO
        !            18:                        ".$schema.$table_name." (clob)
        !            19:                       VALUES (empty_clob())
        !            20:                       ";
        !            21: 
        !            22: $statement = oci_parse($c,$ora_sql);
        !            23: oci_execute($statement);
        !            24: 
        !            25: $ora_sql = "SELECT clob FROM ".$schema.$table_name." FOR UPDATE";
        !            26: $statement = oci_parse($c,$ora_sql);
        !            27: oci_execute($statement, OCI_DEFAULT);
        !            28: 
        !            29: $row = oci_fetch_assoc($statement);
        !            30: 
        !            31: $string = str_repeat("test", 32768*4*4);
        !            32: 
        !            33: for ($i = 0; $i < 8; $i++) {
        !            34:        $row['CLOB']->write($string);
        !            35: }
        !            36: 
        !            37: oci_commit($c);
        !            38: 
        !            39: $ora_sql = "SELECT clob FROM ".$schema.$table_name."";
        !            40: $statement = oci_parse($c,$ora_sql);
        !            41: oci_execute($statement);
        !            42: 
        !            43: $row = oci_fetch_assoc($statement);
        !            44: var_dump(strlen($row['CLOB']->load())); /* here it should fail */
        !            45: 
        !            46: require dirname(__FILE__).'/drop_table.inc';
        !            47: 
        !            48: echo "Done\n";
        !            49: ?>
        !            50: --EXPECTF--    
        !            51: Fatal error: Allowed memory size of 10485760 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d

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