Bug #77116 [NEW]: PDO inTransaction does not have the same value as SESSION_VARIABLE
From: remy dot fox at hotmail dot com
Operating system: Windows
PHP version: 7.2.11
Package: PDO MySQL
Bug Type: Bug
Bug description:PDO inTransaction does not have the same value as SESSION_VARIABLE
Description:
------------
PDO has a function called 'inTransaction', which verifies whether a
transaction is currently active. As far as I can see it calls a method
'in_transaction' here:
https://github.com/php/php-src/blob/master/ext/pdo/pdo_dbh.c
(line 656).
When I start the transaction using SQL ("START TRANSACTION") instead of
the PDO API, the result of inTransaction is always false. However, I'm
confident a transaction is running, because calling "ROLLBACK" does not
commit any changes. On MariaDB, the following query results "1", too:
SELECT SESSION_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE
VARIABLE_NAME = 'in_transaction'.
So I suspect that there is something wrong with the inTransaction
method. It only seems to work when it is called in combination with
beginTransaction, rather than in any case that a transaction was
started.
--
Edit bug report at https://bugs.php.net/bug.php?id=77116&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77116&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77116&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77116&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77116&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77116&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77116&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77116&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77116&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77116&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77116&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77116&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77116&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77116&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77116&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77116&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77116&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77116&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77116&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77116&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77116&r=mysqlcfg
Thread (6 messages)
- remy dot fox at hotmail dot com