Index: database.mysqli.inc
===================================================================
--- database.mysqli.inc	(revision 43)
+++ database.mysqli.inc	(working copy)
@@ -403,6 +403,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(mysqli_query($active_db, "SHOW TABLES FROM " . $match[1] . " LIKE '" . $match[2] . "'"));
+  }
+  
   return db_num_rows(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
 }
 
