PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2_Driver_mysqli » Bug #10105

inTransaction() does not work as documented

Details

Submitted2007-02-15 02:00 UTC
Fromelanthis at awesomeplay dot com
Assignedquipo
StatusClosed
PackageMDB2_Driver_mysqli
PHP Version5.2.1
OSlinux
Roadmaps(Not assigned)

Comments

[2007-02-15 02:00 UTC] elanthis at awesomeplay dot com

Description:
------------
According to the documentation, the inTransaction() method should return true if any transaction is open. However, for the mysqli driver (and also the mysql driver), the inTransaction() method will always return false even if a transaction is open. It will return the number of transactions if nested transactions are in use, however. And yes, I have verified that transactions are actually working. Just not the inTransaction() method.

Test script:
---------------
$db = MDB2::factory(...);

echo "Transactions: {$db->supports('transactions')}<br>";
$db->beginTransaction();
echo "In transaction: {$db->inTransaction()}<br>";

Expected result:
----------------
Transactions: 1
In transaction: 1

Actual result:
--------------
Transactions: 1
In transaction: 0