Index: includes/database/schema.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/schema.inc,v
retrieving revision 1.32
diff -u -p -r1.32 schema.inc
--- includes/database/schema.inc	21 Mar 2010 20:49:01 -0000	1.32
+++ includes/database/schema.inc	25 Mar 2010 13:22:00 -0000
@@ -210,14 +210,13 @@ abstract class DatabaseSchema implements
    *   TRUE if the given table exists, otherwise FALSE.
    */
   public function tableExists($table) {
-    $condition = $this->buildTableNameCondition($this->connection->prefixTables('{' . $table . '}'));
-    $condition->compile($this->connection, $this);
-    // Normally, we would heartily discourage the use of string
-    // concatenation for conditionals like this however, we
-    // couldn't use db_select() here because it would prefix
-    // information_schema.tables and the query would fail.
-    // Don't use {} around information_schema.tables table.
-    return (bool) $this->connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    try {
+      $this->connection->queryRange("SELECT 1 FROM {" . $table . "}", 0, 1);
+      return TRUE;
+    }
+    catch (Exception $e) {
+      return FALSE;
+    }
   }
 
   /**
@@ -253,15 +252,13 @@ abstract class DatabaseSchema implements
    *   TRUE if the given column exists, otherwise FALSE.
    */
   public function columnExists($table, $column) {
-    $condition = $this->buildTableNameCondition($this->connection->prefixTables('{' . $table . '}'));
-    $condition->condition('column_name', $column);
-    $condition->compile($this->connection, $this);
-    // Normally, we would heartily discourage the use of string
-    // concatenation for conditionals like this however, we
-    // couldn't use db_select() here because it would prefix
-    // information_schema.tables and the query would fail.
-    // Don't use {} around information_schema.columns table.
-    return (bool) $this->connection->query("SELECT 1 FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    try {
+      $this->connection->queryRange("SELECT $column FROM {" . $table . "}", 0, 1);
+      return TRUE;
+    }
+    catch (Exception $e) {
+      return FALSE;
+    }
   }
 
   /**
