mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Issue #2194 - Possible Fix for incompatible SQL modes.
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user