summaryrefslogtreecommitdiff
path: root/includes/database/mysql
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-08-05 04:24:31 -0400
committerDavid Rothstein <drothstein@gmail.com>2013-08-05 04:24:31 -0400
commit2df0b841f5a6794ff961033ff21f6d3d7a181b2b (patch)
tree5627a46e6a6c1d7a57851338dbd84814043cc5f0 /includes/database/mysql
parentc2a570914a0c259d7d9d34776b25788c01be5ab1 (diff)
downloadbrdo-2df0b841f5a6794ff961033ff21f6d3d7a181b2b.tar.gz
brdo-2df0b841f5a6794ff961033ff21f6d3d7a181b2b.tar.bz2
Issue #1839998 by wiifm, mcm.guaba, Josh Waihi, dcam: Fixed TruncateQuery implemented as 'DELETE FROM' in MySQL and SQLite, but not PostgreSQL, causing nefarious table locking.
Diffstat (limited to 'includes/database/mysql')
-rw-r--r--includes/database/mysql/query.inc16
1 files changed, 1 insertions, 15 deletions
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc
index 2609aba0c..fa698d90c 100644
--- a/includes/database/mysql/query.inc
+++ b/includes/database/mysql/query.inc
@@ -86,21 +86,7 @@ class InsertQuery_mysql extends InsertQuery {
}
}
-class TruncateQuery_mysql extends TruncateQuery {
- public function __toString() {
- // TRUNCATE is actually a DDL statement on MySQL, and DDL statements are
- // not transactional, and result in an implicit COMMIT. When we are in a
- // transaction, fallback to the slower, but transactional, DELETE.
- if ($this->connection->inTransaction()) {
- // Create a comment string to prepend to the query.
- $comments = $this->connection->makeComment($this->comments);
- return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
- }
- else {
- return parent::__toString();
- }
- }
-}
+class TruncateQuery_mysql extends TruncateQuery { }
/**
* @} End of "addtogroup database".