From 925722a804874eb357eec15b530a394a37092b54 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Thu, 23 Dec 2010 01:39:44 +0000
Subject: [PATCH] #850852 follow-up by Damien Tournoud: Fixed notices that
 caused tests to fail.

---
 includes/database/sqlite/schema.inc | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/includes/database/sqlite/schema.inc b/includes/database/sqlite/schema.inc
index a7871a577dd1..b6f95e4970de 100644
--- a/includes/database/sqlite/schema.inc
+++ b/includes/database/sqlite/schema.inc
@@ -622,16 +622,13 @@ public function fieldSetNoDefault($table, $field) {
   }
 
   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);
   }
-- 
GitLab