--- includes/database.mysql.inc	2008-09-15 02:14:52.000000000 -0400
+++ includes/database.mysql.inc	2008-11-13 13:09:02.000000000 -0500
@@ -420,6 +420,13 @@ function db_unlock_tables() {
  * Check if a table exists.
  */
 function db_table_exists($table) {
+  $prefixed_table = db_prefix_tables('{'.$table.'}');
+  $pattern = '/^([_a-z0-9]+)\\.([-_a-z0-9]+)$/i';  
+  if (preg_match($pattern, $prefixed_table, $match)) {
+    global $active_db;
+    return db_num_rows(mysql_query("SHOW TABLES FROM " . $match[1] . " LIKE '" . $match[2] . "'", $active_db));
+  }
+  
   return db_num_rows(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
 }
 
