Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / oci8 / tests / pecl_bug10194_blob.phpt
blob96f94bcf4c16a88a1e8301fd33223942d01cfa9e
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 (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
8 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
9 if (getenv("USE_ZEND_ALLOC") === "0") {
10     die("skip Zend MM disabled");
12 ?> 
13 --INI--
14 memory_limit=3M
15 --FILE--
16 <?php
18 // This test is dependent on the behavior of the memory manager
19     
20 require(dirname(__FILE__).'/connect.inc');
21 require(dirname(__FILE__).'/create_table.inc');
23 $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob())";
25 $statement = oci_parse($c,$ora_sql);
26 oci_execute($statement);
28 $ora_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE";
29 $statement = oci_parse($c,$ora_sql);
30 oci_execute($statement, OCI_DEFAULT);
32 $row = oci_fetch_assoc($statement);
34 $string = str_repeat("test", 32768*4*4);
36 for ($i = 0; $i < 8; $i++) {
37     $row['BLOB']->write($string);
40 oci_commit($c);
42 $ora_sql = "SELECT blob FROM ".$schema.$table_name;
43 $statement = oci_parse($c,$ora_sql);
44 oci_execute($statement);
46 echo "Before load()\n";
48 $row = oci_fetch_assoc($statement);
49 var_dump(strlen($row['BLOB']->load())); /* here it should fail */
51 require dirname(__FILE__).'/drop_table.inc';
53 echo "Done\n";
55 --EXPECTF-- 
56 Before load()
58 Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d