summaryrefslogtreecommitdiffstatshomepage
path: root/includes/database/sqlite/schema.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-22 21:34:13 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-22 21:34:13 +0000
commita87da0d78a67c307a54ce735aa00b0c6cb11ad69 (patch)
tree9248f88397968f23ff5123ad10ad1511f14a933f /includes/database/sqlite/schema.inc
parent1eb122344a6b383741265228cd2a286dc94ee8de (diff)
downloaddrupal-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.inc15
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);
}