1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--TEST--
oci_set_call_timeout: test timing out
--SKIPIF--
<?php
if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
require(dirname(__FILE__).'/skipif.inc');
if (strcasecmp($user, "system") && strcasecmp($user, "sys")) {
die("skip needs to be run as a user with access to DBMS_LOCK");
}
preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
if (!(isset($matches[0]) && $matches[0] >= 18)) {
die("skip works only with Oracle 18c or greater version of Oracle client libraries");
}
?>
--FILE--
<?php
require(dirname(__FILE__).'/connect.inc');
function mysleep($c, $t)
{
$s = @oci_parse($c, "begin dbms_lock.sleep(:t); end;");
if (!$s) {
$m = oci_error($c);
echo "Execute error was ", $m['message'], "\n";
return;
}
@oci_bind_by_name($s, ":t", $t);
$r = @oci_execute($s);
if ($r) {
echo "Execute succeeded\n";
} else {
$m = oci_error($s);
echo "Execute error was ", $m['message'], "\n";
}
}
echo "Test 1\n";
oci_set_call_timeout($c, 4000); // milliseconds
$r = mysleep($c, 8); // seconds
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
Test 1
Execute error was ORA-03136: %s
===DONE===
|