--- /drupal/modules/schema/engines/nppBackup/schema_mysql.inc.2008-01-03_170646.bak	Wed Dec 05 21:08:34 2007
+++ /drupal/modules/schema/engines/schema_mysql.inc	Thu Jan 03 20:50:23 2008
@@ -85,19 +85,24 @@
 
 function schema_mysql_inspect($name = NULL) {
   global $db_url;
+  global $db_prefix;
 
   $tables = array();
   $url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
   $database = substr($url['path'], 1);
 
-  $sql = ('SELECT * FROM information_schema.COLUMNS '.
-	  'WHERE TABLE_SCHEMA="%s" ');
+  $sql = ('SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA="%s" AND TABLE_NAME LIKE "'.$db_prefix.'%"');
   if (isset($name)) {
     $sql .= 'AND TABLE_NAME = "%s" ';
+  } else {
+    $sql .= 'AND TABLE_NAME LIKE "'.$db_prefix.'%" ';
   }
   $sql .= 'ORDER BY TABLE_NAME, ORDINAL_POSITION';
 
-  $res = db_query($sql, $database, $name);
+  if (isset($name))
+    $res = db_query($sql, $database, $name);
+  else
+    $res = db_query($sql, $database);
   while ($r = db_fetch_array($res)) {
     $numeric = !is_null($r['NUMERIC_SCALE']);
     $col = array();
@@ -133,10 +138,10 @@
     $tables[$r['TABLE_NAME']]['name'] = $r['TABLE_NAME'];
   }
 
-  $res = db_query('SELECT * FROM information_schema.STATISTICS '.
-    'WHERE TABLE_SCHEMA="%s" '.
-    'ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX',
-    $database);
+  $sql = 'SELECT * FROM information_schema.STATISTICS '.
+    'WHERE TABLE_SCHEMA="%s" AND TABLE_NAME LIKE "'.$db_prefix.'%" '.
+    'ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX';
+  $res = db_query($sql, $database);
   while ($r = db_fetch_array($res)) {
     if (isset($r['SUB_PART']) && !is_null($r['SUB_PART'])) {
       $col = array($r['COLUMN_NAME'], intval($r['SUB_PART']));
