From: jvanderleij at desyderetail dot nl
Operating system: Windows XP professional
PHP version: 5.3.0
PHP Bug Type: ODBC related
Bug description: Problem with odbc_autocommit
Description:
------------
In PHP-version 5.3.0 the odbc_autocommit function with second parameter
filled in always returns false. We tested this with sql server and progress
database. In PHP-version 5.2.10 we don't have this problem.
The actual result is the progress output from PHP 5.3.0.
The expected result is the progress output from PHP 5.2.10.
Reproduce code:
---------------
<?php
function reporterror($con, $extramsg)
{
echo $extramsg.'<br>';
$errnum = odbc_error($con);
$errstr = odbc_errormsg ($con);
echo 'error '.$errnum.' errmsg '.$errstr.'<br>';
}
function setisolationlevel($con, $level)
{
$statement = 'SET TRANSACTION ISOLATION LEVEL ' . $level;
$res = odbc_exec ($con, $statement);
if ($res === FALSE)
reporterror($con, 'exec failed '.$statement);
}
function starttransaction($con)
{
$res = odbc_autocommit ($con, false);
if ($res !== TRUE)
reporterror($con, 'odbc_autocommit false failed ');
}
function committransaction($con)
{
$res = odbc_commit($con);
if ($res !== TRUE)
reporterror($con, 'committransaction failed ');
$res = odbc_autocommit ($con, true);
$res = odbc_autocommit ($con, true);
if ($res !== TRUE)
reporterror($con, 'odbc_autocommit true failed ');
}
function test1($con)
{
echo 'test 1<br>';
setisolationlevel($con, 'READ UNCOMMITTED');
starttransaction($con);
$rs = odbc_exec ($con, "SELECT * from tbloctsequence where
seqname =
'testdanny'");
if ($rs === FALSE)
{
reporterror($con, 'exec failed');
echo 'exec failed<br>';
} else
{
echo 'exec succeeded<br>';
for (;;)
{
$ar = odbc_fetch_array($rs);
if ($ar === FALSE)
break;
else
{
print_r($ar);
echo '<br>';
}
}
odbc_free_result ($rs);
}
committransaction($con);
}
function test2($con)
{
echo 'test 2<br>';
setisolationlevel($con, 'READ COMMITTED');
starttransaction($con);
$rs = odbc_exec ($con, "INSERT INTO tblLabelnamen (Naam) VALUES
('testdanny')" );
if ($rs === FALSE)
{
reporterror($con, 'exec failed');
echo 'exec failed<br>';
} else
echo 'exec succeeded<br>';
committransaction($con);
}
$con = odbc_connect ( 'progresstest', 'test' , 'test');
// $con = odbc_connect ( 'mssqltest', 'test' , 'test');
if ($con == 0)
{
echo 'connect failed<br>';
} else
{
echo 'connect succeeded<br>';
test1($con);
test2($con);
odbc_close ($con );
}
?>
Expected result:
----------------
connect succeeded
test 1
exec succeeded
test 2
exec succeeded
Actual result:
--------------
connect succeeded
test 1
odbc_autocommit false failed
error ¸-Ö errmsg
exec succeeded
test 2
exec failed SET TRANSACTION ISOLATION LEVEL READ COMMITTED
error S1000 errmsg [DataDirect][ODBC Progress OpenEdge Wire Protocol
driver][OPENEDGE]Cannot change the transaction isolation level while in a
transaction. (13742)
odbc_autocommit false failed
error S1000 errmsg [DataDirect][ODBC Progress OpenEdge Wire Protocol
driver][OPENEDGE]Cannot change the transaction isolation level while in a
transaction. (13742)
exec failed
error S1000 errmsg [DataDirect][ODBC Progress OpenEdge Wire Protocol
driver][OPENEDGE]Statement not allowed in readonly isolation level (7671)
exec failed
--
Edit bug report at http://bugs.php.net/?id=49429&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49429&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49429&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49429&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49429&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49429&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49429&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49429&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49429&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49429&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49429&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49429&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49429&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49429&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49429&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49429&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49429&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49429&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49429&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49429&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49429&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49429&r=mysqlcfg