diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-22 21:34:13 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-22 21:34:13 +0000 |
commit | a87da0d78a67c307a54ce735aa00b0c6cb11ad69 (patch) | |
tree | 9248f88397968f23ff5123ad10ad1511f14a933f /includes/database/sqlite/schema.inc | |
parent | 1eb122344a6b383741265228cd2a286dc94ee8de (diff) | |
download | drupal-a87da0d78a67c307a54ce735aa00b0c6cb11ad69.tar.gz drupal-a87da0d78a67c307a54ce735aa00b0c6cb11ad69.zip |
#850852 by Damien Tournoud, dmitrig01, chx: Fixed transaction failure and allow concurrent testing on SQLite
Diffstat (limited to 'includes/database/sqlite/schema.inc')
-rw-r--r-- | includes/database/sqlite/schema.inc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/database/sqlite/schema.inc b/includes/database/sqlite/schema.inc index 6830e6b1975..a7871a577dd 100644 --- a/includes/database/sqlite/schema.inc +++ b/includes/database/sqlite/schema.inc @@ -271,7 +271,7 @@ class DatabaseSchema_sqlite extends DatabaseSchema { if (!$this->tableExists($table)) { return FALSE; } - + $this->connection->tableDropped = TRUE; $this->connection->query('DROP TABLE {' . $table . '}'); return TRUE; } @@ -622,9 +622,16 @@ class DatabaseSchema_sqlite extends DatabaseSchema { } public function findTables($table_expression) { - // Don't use {} around sqlite_master table. - $result = db_query("SELECT name FROM sqlite_master WHERE name LIKE :table_name", array( - ':table_name' => $table_expression, + // Don't use getPrefixInfo -- $table_expression includes the prefix. + list($prefix, $table) = explode('.', $table_expression); + if (empty($table)) { + $table = $prefix; + $prefix = NULL; + } + // Can't use query placeholders because the query would have to be + // :prefixsqlite_master, which does not work. + $result = db_query("SELECT name FROM " . ($prefix ? $prefix . '.' : '') . "sqlite_master WHERE name LIKE :table_name", array( + ':table_name' => $table, )); return $result->fetchAllKeyed(0, 0); } |