History log of /PHP-8.2/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt (Results 1 – 3 of 3)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# b5a14e6c 11-Jun-2021 Nikita Popov

Port skipif.inc files to EXTENSIONS

# 7b9519a7 20-Oct-2020 Nikita Popov

Fix inconsistency in PDO transaction state

This addresses an issue introduced by #4996 and reported in
https://bugs.php.net/bug.php?id=80260.

Now that PDO::inTransaction() repor

Fix inconsistency in PDO transaction state

This addresses an issue introduced by #4996 and reported in
https://bugs.php.net/bug.php?id=80260.

Now that PDO::inTransaction() reports the real transaction state
of the connection, there may be a mismatch with PDOs internal
transaction state (in_tcx). This is compounded by the fact that
MySQL performs implicit commits for DDL queries.

This patch fixes the issue by making beginTransaction/commit/rollBack
work on the real transaction state provided by the driver as well
(or falling back to in_tcx if the driver does not support it).

This does mean that writing something like

$pdo->beginTransaction();
$pdo->exec('CREATE DATABASE ...');
$pdo->rollBack(); // <- illegal

will now result in an error, because the CREATE DATABASE already
committed the transaction. I believe this behavior is both correct
and desired -- otherwise, there is no indication that the code did
not behave correctly and the rollBack() was effectively ignored.
However, this is also a BC break.

Closes GH-6355.

show more ...

# 6a4eeb1c 10-Dec-2019 twosee

Improve PDO::inTransaction() support for MySQL

Closes GH-4996.