#850852 follow-up by Damien Tournoud: Fixed notices that caused tests to fail.

merge-requests/26/head
Angie Byron 2010-12-23 01:39:44 +00:00
parent a87da0d78a
commit 925722a804
1 changed files with 5 additions and 8 deletions

View File

@ -622,16 +622,13 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
}
public function findTables($table_expression) {
// Don't use getPrefixInfo -- $table_expression includes the prefix.
list($prefix, $table) = explode('.', $table_expression);
if (empty($table)) {
$table = $prefix;
$prefix = NULL;
}
// Don't add the prefix, $table_expression already includes the prefix.
$info = $this->getPrefixInfo($table_expression, FALSE);
// 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,
$result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE name LIKE :table_name", array(
':table_name' => $info['table'],
));
return $result->fetchAllKeyed(0, 0);
}