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