From 7fd0fe2495364e4bc6cb668f954ff350619c16cf Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 4 Jul 2011 21:48:58 -0700 Subject: Issue #1007830 follow-up by bfroehle: Better fix for nested transactions throw exceptions on ddl changes in MySQL. --- includes/database/mysql/database.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'includes/database/mysql') diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc index bc31feaaf..157cbfa56 100644 --- a/includes/database/mysql/database.inc +++ b/includes/database/mysql/database.inc @@ -169,10 +169,8 @@ class DatabaseConnection_mysql extends DatabaseConnection { // savepoints which no longer exist. // // To avoid exceptions when no actual error has occurred, we silently - // succeed for PDOExceptions with SQLSTATE 42000 ("Syntax error or - // access rule violation") and MySQL error code 1305 ("SAVEPOINT does - // not exist"). - if ($e->getCode() == '42000' && $e->errorInfo[1] == '1305') { + // succeed for MySQL error code 1305 ("SAVEPOINT does not exist"). + if ($e->errorInfo[1] == '1305') { // If one SAVEPOINT was released automatically, then all were. // Therefore, we keep just the topmost transaction. $this->transactionLayers = array('drupal_transaction'); -- cgit v1.2.3