Index: commands/sql/sql.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/sql/sql.drush.inc,v
retrieving revision 1.79
diff -u -p -r1.79 sql.drush.inc
--- commands/sql/sql.drush.inc	21 Dec 2010 05:39:01 -0000	1.79
+++ commands/sql/sql.drush.inc	22 Dec 2010 03:31:51 -0000
@@ -674,10 +674,17 @@ function drush_sql_dump_file(&$db_spec, 
 }
 
 function _drush_sql_get_scheme($db_spec = NULL) {
+  static $drivers;
   if (is_null($db_spec)) {
     $db_spec = _drush_sql_get_db_spec();
   }
-  return $db_spec['driver'];
+  $type = $db_spec['driver'];
+  if (!isset($drivers[$type])) {
+    include_once "./includes/database/database.inc";
+    include_once "./includes/database/$type/database.inc";
+    $drivers[$type] = call_user_func(array("DatabaseConnection_$type", 'driver'));
+  }
+  return $drivers[$type];
 }
 
 /**
Index: includes/environment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/environment.inc,v
retrieving revision 1.107
diff -u -p -r1.107 environment.inc
--- includes/environment.inc	6 Dec 2010 21:57:08 -0000	1.107
+++ includes/environment.inc	22 Dec 2010 03:31:52 -0000
@@ -1154,6 +1154,13 @@ function drush_valid_db_credentials() {
         drush_log(dt('PDO support is required.'), 'bootstrap');
         return FALSE;
       }
+
+      if (file_exists("./includes/database/$type/database.inc")) {
+        include_once "./includes/database/database.inc";
+        include_once "./includes/database/$type/database.inc";
+        $type = call_user_func(array("DatabaseConnection_$type", 'driver'));
+      }
+
       // Check the database specific driver is available.
       if (!in_array($type, PDO::getAvailableDrivers())) {
         drush_log(dt('!type extension for PHP PDO is not installed. Check your php.ini to see how you can enable it.', array('!type' => $type)), 'bootstrap');
