From a6a58c16ebf3907f28e16ee924704cce08a67774 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 2 Nov 2008 06:33:56 +0000 Subject: - Patch #319394 by Crell: force the default database for registry queries. --- includes/bootstrap.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 55bf09574..c3f553793 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1447,7 +1447,10 @@ function drupal_autoload_class($class) { * Helper to check for a resource in the registry. */ function _registry_check_code($type, $name) { - $file = db_query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array( + // This function may get called when the default database is not active, but + // there is no reason we'd ever want to not use the default database for + // this query. + $file = Database::getConnection('default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array( ':name' => $name, ':type' => $type, )) @@ -1507,7 +1510,10 @@ function registry_cache_path_files() { $type_sql = array(); $params = array(); - $select = db_select('registry')->distinct(); + // This function may get called when the default database is not active, but + // there is no reason we'd ever want to not use the default database for + // this query. + $select = Database::getConnection('default')->select('registry')->distinct(); $select->addField('registry', 'filename'); // This creates a series of 2-clause AND conditions that are then ORed together. -- cgit v1.2.3