- Patch #897650 by Garrett Albright, Damien Tournoud: DatabaseSchema_sqlite()::findTables() shouldn't find indexes.

merge-requests/26/head
Dries Buytaert 2011-09-11 17:09:40 -04:00
parent aa78d4987d
commit a2e549e35c
1 changed files with 4 additions and 3 deletions

View File

@ -672,9 +672,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
// Don't add the prefix, $table_expression already includes the prefix. // Don't add the prefix, $table_expression already includes the prefix.
$info = $this->getPrefixInfo($table_expression, FALSE); $info = $this->getPrefixInfo($table_expression, FALSE);
// Can't use query placeholders because the query would have to be // Can't use query placeholders for the schema because the query would have
// :prefixsqlite_master, which does not work. // to be :prefixsqlite_master, which does not work.
$result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE name LIKE :table_name", array( $result = db_query("SELECT name FROM " . $info['schema'] . ".sqlite_master WHERE type = :type AND name LIKE :table_name", array(
':type' => 'table',
':table_name' => $info['table'], ':table_name' => $info['table'],
)); ));
return $result->fetchAllKeyed(0, 0); return $result->fetchAllKeyed(0, 0);