=== modified file 'includes/bootstrap.inc'
--- includes/bootstrap.inc	2009-12-07 07:25:24 +0000
+++ includes/bootstrap.inc	2009-12-14 20:24:43 +0000
@@ -657,16 +657,18 @@ function drupal_get_filename($type, $nam
   // before we have a database connection (i.e. during installation) and
   // when a database connection fails.
   else {
-    try {
-      $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
-      if (file_exists($file)) {
-        $files[$type][$name] = $file;
+    if (function_exists('db_query')) {
+      try {
+        $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
+        if (file_exists($file)) {
+          $files[$type][$name] = $file;
+        }
+      }
+      catch (PDOException $e) {
+        // The database table may not exist because Drupal is not yet installed,
+        // or the database might be down. We have a fallback for this case so we
+        // hide the error completely.
       }
-    }
-    catch (PDOException $e) {
-      // The database table may not exist because Drupal is not yet installed,
-      // or the database might be down. We have a fallback for this case so we
-      // hide the error completely.
     }
     // Fallback to searching the filesystem if the database could not find the
     // file or the file returned by the database is not found.

