mirror of
https://github.com/php/php-src.git
synced 2025-01-06 02:43:34 +08:00
08eaa56798
Code: - Do scope-end release for oci_pconnect (oci8.old_oci_close_semantics=1 gives old behavior) - Fix session reuse with 10.2 client libs - Fix the Ping macro version check for 10.2 - Add type check associated with zend_list_find - Code connection re-organized for reuse - Format comments - WS changes - Prepare for new PECL release Tests: - Add new tests - Rationalize password tests - Revert use of __DIR__ so tests will work with PHP 5.2 - Update some skipifs to make tests more portable
61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
--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
|