File: drcp_scope3.phpt

package info (click to toggle)
php5 5.6.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 150,376 kB
  • sloc: ansic: 727,510; php: 21,966; sh: 12,356; cpp: 8,763; xml: 6,105; yacc: 1,551; exp: 1,514; makefile: 1,461; pascal: 1,048; awk: 538; perl: 315; sql: 22
file content (61 lines) | stat: -rw-r--r-- 1,583 bytes parent folder | download | duplicates (7)
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
52
53
54
55
56
57
58
59
60
61
--TEST--
DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--INI--
oci8.old_oci_close_semantics=1
--FILE--
<?php

require dirname(__FILE__)."/drcp_functions.inc";
require dirname(__FILE__)."/details.inc";

// The test opens a connection within function1 and updates a table
// (without committing).  Another connection is opened from function
// 2, and the table queried.  When function1 ends, the connection from
// function1 is not closed, so the updated value will be seen in
// function2.  Also the table can't be dropped because an uncommitted
// transaction exists.

// Create the table
$c = oci_new_connect($user,$password,$dbase);
@drcp_drop_table($c);
drcp_create_table($c);

echo "This is with a OCI_PCONNECT\n";
function1($user,$password,$dbase);

// Should return the OLD value
function2($user,$password,$dbase);

// This is the first scope for the script

function function1($user,$password,$dbase)
{
	var_dump($c = oci_pconnect($user,$password,$dbase));
	drcp_update_table($c);
}

// This is the second scope

function function2($user,$password,$dbase)
{
	var_dump($c = oci_pconnect($user,$password,$dbase));
	drcp_select_value($c);
}

drcp_drop_table($c);
oci_close($c);

echo "Done\n";

?>
--EXPECTF--
This is with a OCI_PCONNECT
resource(%d) of type (oci8 persistent connection)
Update done-- DEPT value has been set to NEWDEPT
resource(%d) of type (oci8 persistent connection)
The value of DEPT for id 105 is NEWDEPT

Warning: oci_execute(): ORA-00054: %s
Done