Alter DB() to check if a subdriver is available
diff --git a/system/database/DB.php b/system/database/DB.php
index 00d14b4..638b51b 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -144,7 +144,10 @@
 	// Load the DB driver
 	$driver_file = BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php';
 
-	if ( ! file_exists($driver_file)) show_error('Invalid DB driver');
+	if ( ! file_exists($driver_file))
+	{
+		show_error('Invalid DB driver');
+	}
 
 	require_once($driver_file);
 
@@ -152,6 +155,19 @@
 	$driver = 'CI_DB_'.$params['dbdriver'].'_driver';
 	$DB = new $driver($params);
 
+	// Check for a subdriver
+	if ( ! empty($DB->subdriver) && empty($params['subdriver']))
+	{
+		$driver_file = BASEPATH.'database/drivers/'.$param['dbdriver'].'/subdrivers/'.$params['dbdriver'].'_'.$params['subdriver'].'_driver.php';
+
+		if (file_exists($driver_file))
+		{
+			require_once($driver_file);
+			$driver = 'CI_DB_'.$params['dbdriver'].'_'.$params['subdriver'].'_driver';
+			$DB = new $driver($params);
+		}
+	}
+
 	if ($DB->autoinit === TRUE)
 	{
 		$DB->initialize();