Index: database.mysql.inc
===================================================================
--- database.mysql.inc	(revision 43)
+++ database.mysql.inc	(working copy)
@@ -420,6 +420,13 @@
  * 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) . "}'"));
 }
 
