summaryrefslogtreecommitdiff
path: root/includes/database/mysql/database.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-06-04 11:03:49 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-06-04 11:03:49 -0700
commit2647e116425d02e7b5c6207a7ea4a8f06080d4b1 (patch)
treeec403520678d51b44740fed31696160322d2ab71 /includes/database/mysql/database.inc
parent624f5a7c0a330288187c8167a2c7214f7d14c8af (diff)
downloadbrdo-2647e116425d02e7b5c6207a7ea4a8f06080d4b1.tar.gz
brdo-2647e116425d02e7b5c6207a7ea4a8f06080d4b1.tar.bz2
Issue #1007830 follow-up by bfroehle: Add more specificity to MySQL nested DDL transaction error check.
Diffstat (limited to 'includes/database/mysql/database.inc')
-rw-r--r--includes/database/mysql/database.inc15
1 files changed, 9 insertions, 6 deletions
diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc
index 47ef8d52e..bc31feaaf 100644
--- a/includes/database/mysql/database.inc
+++ b/includes/database/mysql/database.inc
@@ -169,14 +169,17 @@ 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 error code 42000 ("Syntax error or
- // access rule violation").
- if ($e->getCode() != '42000') {
+ // 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') {
+ // If one SAVEPOINT was released automatically, then all were.
+ // Therefore, we keep just the topmost transaction.
+ $this->transactionLayers = array('drupal_transaction');
+ }
+ else {
throw $e;
}
- // If one SAVEPOINT was released automatically, then all were.
- // Therefore, we keep just the topmost transaction.
- $this->transactionLayers = array('drupal_transaction');
}
break;
}