Annotation of embedaddon/php/ext/oci8/tests/drcp_scope3.phpt, revision 1.1.1.1

1.1       misho       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
                      9: 
                     10: require dirname(__FILE__)."/drcp_functions.inc";
                     11: require dirname(__FILE__)."/details.inc";
                     12: 
                     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.
                     19: 
                     20: // Create the table
                     21: $c = oci_new_connect($user,$password,$dbase);
                     22: @drcp_drop_table($c);
                     23: drcp_create_table($c);
                     24: 
                     25: echo "This is with a OCI_PCONNECT\n";
                     26: function1($user,$password,$dbase);
                     27: 
                     28: // Should return the OLD value
                     29: function2($user,$password,$dbase);
                     30: 
                     31: // This is the first scope for the script
                     32: 
                     33: function function1($user,$password,$dbase)
                     34: {
                     35:        var_dump($c = oci_pconnect($user,$password,$dbase));
                     36:        drcp_update_table($c);
                     37: }
                     38: 
                     39: // This is the second scope
                     40: 
                     41: function function2($user,$password,$dbase)
                     42: {
                     43:        var_dump($c = oci_pconnect($user,$password,$dbase));
                     44:        drcp_select_value($c);
                     45: }
                     46: 
                     47: drcp_drop_table($c);
                     48: oci_close($c);
                     49: 
                     50: echo "Done\n";
                     51: 
                     52: ?>
                     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
                     59: 
                     60: Warning: oci_execute(): ORA-00054: %s
                     61: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>