Bug #80410 [NEW]: PDO closes active transaction after $stmt->execute()
| From: | smissot at gmail dot com | Date: | Tue, 24 Nov 2020 16:33:07 +0000 |
| Subject: | Bug #80410 [NEW]: PDO closes active transaction after $stmt->execute() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-230586@lists.php.net to get a copy of this message | ||
From: smissot at gmail dot com
Operating system: Debian
PHP version: 8.0.0RC5
Package: PDO MySQL
Bug Type: Bug
Bug description:PDO closes active transaction after $stmt->execute()
Description:
------------
PHP 8.0.0RC5 (cli) (built: Nov 19 2020 19:38:09) ( NTS )
MariaDB Version: 10.5.6-MariaDB-1:10.5.6+maria~focal
When executing a PDO statement, inTransaction() returns false
afterwards.
This was not the case in PHP7.4 and before. Once I tested our
application on PHP8.0RC5 I encountered this issue.
I am using ATTR_EMULATE_PREPARES as we have other issues when this is
turned off.
In our application, we do have nested transactions due to Laravel
s testing framework, so this issue may be related to this.
Test script:
---------------
// SQL Query grabbed from mysql.general_log that is executed by both 7.4
and 8.0RC5
CALL myProcedure('2')
// Prepare
$pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare('CALL myProcedure(?);', [\PDO::ATTR_CURSOR =>
\PDO::CURSOR_SCROLL]);
$stmt->bindValue(1, '2');
// 7.4
dump($pdo->inTransaction()); // true
$exec = $stmt->execute();
dump($pdo->inTransaction()); // true
// 8.0RC5
dump($pdo->inTransaction()); // true
$exec = $stmt->execute();
dump($pdo->inTransaction()); // false
Expected result:
----------------
true
true
Actual result:
--------------
true
false
--
Edit bug report at https://bugs.php.net/bug.php?id=80410&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80410&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80410&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80410&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80410&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80410&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80410&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80410&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80410&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80410&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80410&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80410&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80410&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80410&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80410&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80410&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80410&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80410&r=mysqlcfg