Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / oci8 / tests / drcp_scope3.phpt
blobb448a518adcc4ab3b61f4fafd5fc0b2934dafc48
1 --TEST--
2 DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON
3 --SKIPIF--
4 <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
5 --INI--
6 oci8.old_oci_close_semantics=1
7 --FILE--
8 <?php
10 require dirname(__FILE__)."/drcp_functions.inc";
11 require dirname(__FILE__)."/details.inc";
13 // The test opens a connection within function1 and updates a table
14 // (without committing).  Another connection is opened from function
15 // 2, and the table queried.  When function1 ends, the connection from
16 // function1 is not closed, so the updated value will be seen in
17 // function2.  Also the table can't be dropped because an uncommitted
18 // transaction exists.
20 // Create the table
21 $c = oci_new_connect($user,$password,$dbase);
22 @drcp_drop_table($c);
23 drcp_create_table($c);
25 echo "This is with a OCI_PCONNECT\n";
26 function1($user,$password,$dbase);
28 // Should return the OLD value
29 function2($user,$password,$dbase);
31 // This is the first scope for the script
33 function function1($user,$password,$dbase)
35         var_dump($c = oci_pconnect($user,$password,$dbase));
36         drcp_update_table($c);
39 // This is the second scope
41 function function2($user,$password,$dbase)
43         var_dump($c = oci_pconnect($user,$password,$dbase));
44         drcp_select_value($c);
47 drcp_drop_table($c);
48 oci_close($c);
50 echo "Done\n";
53 --EXPECTF--
54 This is with a OCI_PCONNECT
55 resource(%d) of type (oci8 persistent connection)
56 Update done-- DEPT value has been set to NEWDEPT
57 resource(%d) of type (oci8 persistent connection)
58 The value of DEPT for id 105 is NEWDEPT
60 Warning: oci_execute(): ORA-00054: %s
61 Done