xref: /PHP-8.1/ext/oci8/tests/bug44113.phpt (revision b5a14e6c)
1--TEST--
2Bug #44113 (New collection creation can fail with OCI-22303)
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
8require(__DIR__.'/skipif.inc');
9if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
10?>
11--FILE--
12<?php
13
14require(__DIR__.'/connect.inc');
15
16// Initialization
17
18$stmtarray = array(
19    "create or replace type bug44113_list_t as table of number"
20);
21
22oci8_test_sql_execute($c, $stmtarray);
23
24// Run Test
25// The test can take some time to complete and can exceed PHP's test
26// timeout limit on slow networks.
27
28for ($x = 0; $x < 70000; $x++) {
29    if (!($var = oci_new_collection($c, 'BUG44113_LIST_T'))) {
30        print "Failed new collection creation on $x\n";
31        break;
32    }
33}
34
35print "Completed $x\n";
36
37// Cleanup
38
39$stmtarray = array(
40    "drop type bug44113_list_t"
41);
42
43oci8_test_sql_execute($c, $stmtarray);
44
45echo "Done\n";
46
47?>
48--EXPECT--
49Completed 70000
50Done
51