Merge pull request #325 from freewil/develop

always use charset config item
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php
index 2d2905c..6ceaf4b 100644
--- a/system/database/drivers/mysql/mysql_result.php
+++ b/system/database/drivers/mysql/mysql_result.php
@@ -86,10 +86,10 @@
 		$retval = array();
 		while ($field = mysql_fetch_object($this->result_id))
 		{
-			preg_match('/([a-zA-Z]+)\((\d+)\)/', $field->Type, $matches);
+			preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches);
 
 			$type = $matches[1];
-			$length = (int)$matches[2];
+			$length = isset($matches[3]) ? (int) $matches[3] : NULL;
 
 			$F				= new stdClass();
 			$F->name		= $field->Field;
diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php
index ac86305..bbfb848 100644
--- a/system/database/drivers/mysqli/mysqli_result.php
+++ b/system/database/drivers/mysqli/mysqli_result.php
@@ -86,10 +86,10 @@
 		$retval = array();
 		while ($field = mysqli_fetch_object($this->result_id))
 		{
-			preg_match('/([a-zA-Z]+)\((\d+)\)/', $field->Type, $matches);
+			preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches);
 
 			$type = $matches[1];
-			$length = (int)$matches[2];
+			$length = isset($matches[3]) ? (int) $matches[3] : NULL;
 
 			$F				= new stdClass();
 			$F->name		= $field->Field;
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 3943ec1..3734e18 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -57,7 +57,7 @@
 		}
 
 		// If not set, set it
-		$this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/';
+		$this->_migration_path == '' AND $this->_migration_path = APPPATH . 'migrations/';
 
 		// Add trailing slash if not set
 		$this->_migration_path = rtrim($this->_migration_path, '/').'/';