summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-06 16:54:15 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-06 16:54:15 +0000
commit36088732bb11e05ee4a14a3d1101615a1891f93f (patch)
treead9631af100b4fbb34b545f22cdb891bd85ecbae /includes
parent1201676f3d7c132a3f1f7ddbc0eb35be2197cd99 (diff)
downloadbrdo-36088732bb11e05ee4a14a3d1101615a1891f93f.tar.gz
brdo-36088732bb11e05ee4a14a3d1101615a1891f93f.tar.bz2
- Patch #669794 by andypost, Josh Waihi, aspilicious, moshe weitzman, catch: use savepoints for nested transactions.
Diffstat (limited to 'includes')
-rw-r--r--includes/database/database.inc11
-rw-r--r--includes/database/sqlite/database.inc8
2 files changed, 16 insertions, 3 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index ab2b5829c..a85489a5b 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -896,6 +896,14 @@ abstract class DatabaseConnection extends PDO {
if ($this->supportsTransactions()) {
parent::rollBack();
}
+ else {
+ // Log unsupported rollback.
+ $this->rollbackLogs[] = array(
+ 'type' => 'database',
+ 'message' => t('Explicit rollback failed: not supported on active connection.'),
+ 'variables' => array(),
+ );
+ }
$this->logRollback();
}
@@ -911,9 +919,6 @@ abstract class DatabaseConnection extends PDO {
$logging_callback = $logging['callback'];
- // Log the failed rollback.
- call_user_func($logging_callback, 'database', 'Explicit rollback failed: not supported on active connection.', array(), $logging['error_severity']);
-
// Play back the logged errors to the specified logging callback post-
// rollback.
foreach ($this->rollbackLogs as $log_item) {
diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc
index da3ca3525..ba28ca63b 100644
--- a/includes/database/sqlite/database.inc
+++ b/includes/database/sqlite/database.inc
@@ -265,6 +265,14 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
if ($this->supportsTransactions()) {
PDO::rollBack();
}
+ else {
+ // Log unsupported rollback.
+ $this->rollbackLogs[] = array(
+ 'type' => 'database',
+ 'message' => t('Explicit rollback failed: not supported on active connection.'),
+ 'variables' => array(),
+ );
+ }
$this->logRollback();
}