Index: includes/database/mysql/schema.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/mysql/schema.inc,v
retrieving revision 1.34
diff -u -r1.34 schema.inc
--- includes/database/mysql/schema.inc	28 Mar 2010 11:45:11 -0000	1.34
+++ includes/database/mysql/schema.inc	1 Apr 2010 21:46:34 -0000
@@ -49,6 +49,47 @@
   }
 
   /**
+   * Check if a table exists.
+   *
+   * @param $table
+   *   The name of the table in drupal (no prefixing).
+   *
+   * @return
+   *   TRUE if the given table exists, otherwise FALSE.
+   */
+  function tableExists($table) {
+    try {
+      $this->connection->queryRange("SELECT 1 FROM {" . $table . "}", 0, 1);
+      return TRUE;
+    }
+    catch (Exception $e) {
+      return FALSE;
+    }
+
+  }
+
+  /**
+   * Check if a column exists in the given table.
+   *
+   * @param $table
+   *   The name of the table in drupal (no prefixing).
+   * @param $name
+   *   The name of the column.
+   *
+   * @return
+   *   TRUE if the given column exists, otherwise FALSE.
+   */
+  function fieldExists($table, $column) {
+    try {
+      $this->connection->queryRange("SELECT $column FROM {" . $table . "}", 0, 1);
+      return TRUE;
+    }
+    catch (Exception $e) {
+      return FALSE;
+    }
+  }
+
+  /**
    * Generate SQL to create a new table from a Drupal schema definition.
    *
    * @param $name

