From:             amonw at hotmail dot com
Operating system: redhat linux 7.2
PHP version:      4.3.10
PHP Bug Type:     OCI8 related
Bug description:  ocicommit not working

Description:
------------
ocicommit not working in the following code when connected to oracle 8.1.7
.
The oddest thing is I can avoid this by doing any one of the following:
1. don't use the user defined function "query", and used it's content to
replace the function calls
or 
2. use different veriable name for the two connections
or
3. use different veriable name for the two query results
or
4. add $statement=anything or unset($statement) before the second
"$statement=query($c,$sql)"

configure command(from phpinfo()):
'./configure' '--with-apxs' '--with-gd' '--with-oci8=shared' '--with-zlib'
'--with-jpeg-dir' '--enable-gd-native-ttf' '--with-freetype-dir'
'--with-ttf' '--enable-ftp' 

Reproduce code:
---------------
<?php
function query($conn,$sqlstr)
{
        $statement=ociparse($conn,$sqlstr);
        ociexecute($statement,OCI_DEFAULT);
        return $statement;
} 
dl('oci8.so');
$c=ocilogon('user','pwd');      
$sql="select sysdate from dual";
$statement=query($c,$sql);
$c=ocilogon('user','pwd');
$sql="delete from info_user where device_number='1234567890'";
$statement=query($c,$sql);
if(!ocicommit($c))
{
       $error = OCIError($c); 
       echo 'Commit failed. Oracle reports: ' . $error['message']; 
}
print("$sql :".ocirowcount($statement).' records updated.');
?>

Expected result:
----------------
Prints out "delete from info_user where device_number='1234567890' :x
records deleted" and
all records with device_number='1234567890' should be deleted.

Actual result:
--------------
Prints out "delete from info_user where device_number='1234567890' :x
records deleted" but no records was deleted.

-- 
Edit bug report at http://bugs.php.net/?id=31222&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31222&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31222&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31222&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31222&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31222&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31222&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31222&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31222&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31222&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31222&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31222&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31222&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31222&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31222&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31222&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31222&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31222&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31222&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31222&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31222&r=mysqlcfg

Reply via email to