Skip to content
Snippets Groups Projects
Commit 60ebceeb authored by pounard's avatar pounard
Browse files

Fixes #1567438 - Wrong transaction type was being catched in a MySQL...

Fixes #1567438 - Wrong transaction type was being catched in a MySQL transaction specific loop when releasing transactions
parent 037ac940
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -7,6 +7,8 @@
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Core\Database\DatabaseExceptionWrapper;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\TransactionCommitFailedException;
use Drupal\Core\Database\DatabaseException;
......@@ -180,7 +182,7 @@ protected function popCommittableTransactions() {
try {
$this->query('RELEASE SAVEPOINT ' . $name);
}
catch (PDOException $e) {
catch (DatabaseExceptionWrapper $e) {
// However, in MySQL (InnoDB), savepoints are automatically committed
// when tables are altered or created (DDL transactions are not
// supported). This can cause exceptions due to trying to release
......@@ -188,7 +190,7 @@ protected function popCommittableTransactions() {
//
// To avoid exceptions when no actual error has occurred, we silently
// succeed for MySQL error code 1305 ("SAVEPOINT does not exist").
if ($e->errorInfo[1] == '1305') {
if ($e->getPrevious()->errorInfo[1] == '1305') {
// If one SAVEPOINT was released automatically, then all were.
// Therefore, clean the transaction stack.
$this->transactionLayers = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment