From 241e8bec78c3271f5d9d690796842aff99924d13 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 11 Jan 2017 13:30:57 -0800 Subject: [PATCH] Issue #2194 - Possible Fix for incompatible SQL modes. --- e107_handlers/mysql_class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index bd82a3a05..1d546344a 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -231,7 +231,7 @@ class e_db_mysql // Set utf8 connection? //@TODO: simplify when yet undiscovered side-effects will be fixed $this->db_Set_Charset(); - + $this->setSQLMode(); // if ($this->pdo!== true && !@mysql_select_db($this->mySQLdefaultdb, $this->mySQLaccess)) if (!$this->database($this->mySQLdefaultdb)) @@ -259,7 +259,6 @@ class e_db_mysql - /** * Connect ONLY - used in v2.x * @param string $mySQLserver IP Or hostname of the MySQL server @@ -316,6 +315,7 @@ class e_db_mysql } $this->db_Set_Charset(); + $this->setSQLMode(); if ($db_ConnectionID == NULL){ $db_ConnectionID = $this->mySQLaccess; } @@ -2664,6 +2664,15 @@ class e_db_mysql return $this->mySQLlastQuery; } + private function setSQLMode() + { + + $this->db_Query("SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';"); + + } + + + /** * Check if MySQL version is utf8 compatible and may be used as it accordingly to the user choice *