diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-02 06:33:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-02 06:33:56 +0000 |
commit | a6a58c16ebf3907f28e16ee924704cce08a67774 (patch) | |
tree | 828a979b165beb08bd3e6c4aedea0a810ace5d71 /includes/bootstrap.inc | |
parent | dc42384557cc93a2b5a7df25b75fef76dff15f58 (diff) | |
download | brdo-a6a58c16ebf3907f28e16ee924704cce08a67774.tar.gz brdo-a6a58c16ebf3907f28e16ee924704cce08a67774.tar.bz2 |
- Patch #319394 by Crell: force the default database for registry queries.
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r-- | includes/bootstrap.inc | 10 |
1 files changed, 8 insertions, 2 deletions
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. |