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

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');
1.1.1.2 ! misho       8: if (getenv("USE_ZEND_ALLOC") === "0") {
        !             9:     die("skip Zend MM disabled");
        !            10: }
1.1       misho      11: ?> 
                     12: --INI--
                     13: memory_limit=10M
                     14: --FILE--
                     15: <?php
                     16:        
                     17: require dirname(__FILE__).'/connect.inc';
                     18: require dirname(__FILE__).'/create_table.inc';
                     19: 
                     20: $ora_sql = "INSERT INTO
                     21:                        ".$schema.$table_name." (clob)
                     22:                       VALUES (empty_clob())
                     23:                       ";
                     24: 
                     25: $statement = oci_parse($c,$ora_sql);
                     26: oci_execute($statement);
                     27: 
                     28: $ora_sql = "SELECT clob FROM ".$schema.$table_name." FOR UPDATE";
                     29: $statement = oci_parse($c,$ora_sql);
                     30: oci_execute($statement, OCI_DEFAULT);
                     31: 
                     32: $row = oci_fetch_assoc($statement);
                     33: 
                     34: $string = str_repeat("test", 32768*4*4);
                     35: 
                     36: for ($i = 0; $i < 8; $i++) {
                     37:        $row['CLOB']->write($string);
                     38: }
                     39: 
                     40: oci_commit($c);
                     41: 
                     42: $ora_sql = "SELECT clob FROM ".$schema.$table_name."";
                     43: $statement = oci_parse($c,$ora_sql);
                     44: oci_execute($statement);
                     45: 
                     46: $row = oci_fetch_assoc($statement);
                     47: var_dump(strlen($row['CLOB']->load())); /* here it should fail */
                     48: 
                     49: require dirname(__FILE__).'/drop_table.inc';
                     50: 
                     51: echo "Done\n";
                     52: ?>
                     53: --EXPECTF--    
                     54: 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>