summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-01-11 11:09:52 +0100
committerAndrey Andreev <narf@devilix.net>2016-01-11 11:09:52 +0100
commit38b08116c61c0a68e6d350c986f75589220692ed (patch)
treefa8a9b5a0f0be955d42110b67037d1ff46e54604 /system/database/drivers/mysql
parent34251bfec2627fb0526d5f99f3a13a3d8a4506d8 (diff)
parentfd5fe1a64c03ae7204a7e72d936215f7a61d8c30 (diff)
Merge branch '3.0-stable' into develop
Resolved conflicts: system/database/drivers/mysql/mysql_driver.php system/database/drivers/mysqli/mysqli_driver.php
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 3fafe3fd8..bbda83e58 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -84,7 +84,7 @@ class CI_DB_mysql_driver extends CI_DB {
*
* @var bool
*/
- public $stricton = FALSE;
+ public $stricton;
// --------------------------------------------------------------------
@@ -156,9 +156,26 @@ class CI_DB_mysql_driver extends CI_DB {
return ($this->db->debug) ? $this->display_error('db_unable_to_set_charset', $this->char_set) : FALSE;
}
- if ($this->stricton)
+ if (isset($this->stricton))
{
- $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(REPLACE(REPLACE(REPLACE(
+ @@sql_mode,
+ "STRICT_ALL_TABLES,", ""),
+ ",STRICT_ALL_TABLES", ""),
+ "STRICT_ALL_TABLES", ""),
+ "STRICT_TRANS_TABLES,", ""),
+ ",STRICT_TRANS_TABLES", ""),
+ "STRICT_TRANS_TABLES", "")'
+ );
+ }
}
return $this->conn_id;