summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-01-07 16:27:39 +0100
committerAndrey Andreev <narf@devilix.net>2016-01-07 16:27:39 +0100
commitc83e894fe8b3c85ff40f00954df0033ad14940b0 (patch)
treeae209253c858db0fe361b4c647e11a5c4da81ca9 /system/database/drivers/mysql/mysql_driver.php
parentb98c657c100d3220a5d7ed1b6ff3ec78e227b406 (diff)
Add MySQL stricton changes to mysqli and pdo/mysql drivers
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index d9c1a98a6..607388a61 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;
// --------------------------------------------------------------------
@@ -153,19 +153,18 @@ class CI_DB_mysql_driver extends CI_DB {
{
$this->simple_query('SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")');
}
- else
+ elseif (version_compare($this->version, '5.7', '>='))
{
$this->simple_query(
'SET SESSION sql_mode =
- REPLACE(
- REPLACE(
- REPLACE(@@sql_mode, "STRICT_ALL_TABLES,", ""),
- ",STRICT_ALL_TABLES",
- ""
- ),
- "STRICT_ALL_TABLES",
- ""
- )'
+ 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", "")'
);
}
}