Bug #80260 [Opn->Csd]: PDO::inTransaction() returns false when inside transaction
| From: | nikic@php.net | Date: | Wed, 28 Oct 2020 09:18:50 +0000 |
| Subject: | Bug #80260 [Opn->Csd]: PDO::inTransaction() returns false when inside transaction | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229961@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80260&edit=1
ID: 80260
Updated by: nikic@php.net
Reported by: corey dot taylor dot fl at gmail dot com
Summary: PDO::inTransaction() returns false when inside
transaction
-Status: Open
+Status: Closed
Type: Bug
Package: PDO MySQL
PHP Version: 8.0.0RC2
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Thanks for checking! We'll have to see if this causes any other issues...
Previous Comments:
------------------------------------------------------------------------
[2020-10-27 21:13:24] corey dot taylor dot fl at gmail dot com
I can confirm the committed patch resolves the issue of PDO getting out of sync with server
transaction status.
------------------------------------------------------------------------
[2020-10-20 10:04:12] nikic@php.net
I've opened a PR that should fix your usage (if inTransaction commit), but may break other
usages (unconditional commit/rollBack despite an implicit commit). As such, I'm not completely
sure whether this will go forward.
------------------------------------------------------------------------
[2020-10-20 10:03:48] corey dot taylor dot fl at gmail dot com
I see now that the implicit commit closes the transaction on the server so there is no valid
"commit" after the DDL statement. I thought it just committed the changes and left the
transaction open where a commit was expected. We haven't had to inspect the mysql transaction
support recently.
If the issue is entirely on the PDO side, then we can handle inTransaction() returning false
(correctly) as long as beginTransaction() doesn't throw the error.
------------------------------------------------------------------------
[2020-10-20 09:48:20] nikic@php.net
The following pull request has been associated:
Patch Name: Fix inconsistency in PDO transaction state
On GitHub: https://github.com/php/php-src/pull/6355
Patch: https://github.com/php/php-src/pull/6355.patch
------------------------------------------------------------------------
[2020-10-20 08:54:55] corey dot taylor dot fl at gmail dot com
If this turns out to be *entirely* due to DDL transactions - are you saying that
PDO::inTransaction() won't support them?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80260
--
Edit this bug report at https://bugs.php.net/bug.php?id=80260&edit=1