Fix MySQL's 'stricton' feature
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 9c630d0..d9c1a98 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -147,9 +147,27 @@
 				: FALSE;
 		}
 
-		if ($this->stricton && is_resource($this->conn_id))
+		if (isset($this->stricton) && is_resource($this->conn_id))
 		{
-			$this->simple_query('SET SESSION sql_mode="STRICT_ALL_TABLES"');
+			if ($this->stricton)
+			{
+				$this->simple_query('SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")');
+			}
+			else
+			{
+				$this->simple_query(
+					'SET SESSION sql_mode =
+						REPLACE(
+							REPLACE(
+								REPLACE(@@sql_mode, "STRICT_ALL_TABLES,", ""),
+								",STRICT_ALL_TABLES",
+								""
+							),
+							"STRICT_ALL_TABLES",
+							""
+						)'
+				);
+			}
 		}
 
 		return $this->conn_id;