Skip to content

Commit

Permalink
Merge pull request #5425 from kenjis/fix-mysql-ANSI_QUOTES
Browse files Browse the repository at this point in the history
fix: errors when MariaDB/MySQL has `ANSI_QUOTES` enabled
  • Loading branch information
kenjis committed Dec 8, 2021
2 parents 90edc48 + 9ddc239 commit 262cf0b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions system/Database/MySQLi/Connection.php
Expand Up @@ -100,19 +100,19 @@ public function connect(bool $persistent = false)
if ($this->strictOn) {
$this->mysqli->options(
MYSQLI_INIT_COMMAND,
'SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")'
"SET SESSION sql_mode = CONCAT(@@sql_mode, ',', 'STRICT_ALL_TABLES')"
);
} else {
$this->mysqli->options(
MYSQLI_INIT_COMMAND,
'SET SESSION sql_mode = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
"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", "")'
'STRICT_ALL_TABLES,', ''),
',STRICT_ALL_TABLES', ''),
'STRICT_ALL_TABLES', ''),
'STRICT_TRANS_TABLES,', ''),
',STRICT_TRANS_TABLES', ''),
'STRICT_TRANS_TABLES', '')"
);
}
}
Expand Down

0 comments on commit 262cf0b

Please sign in to comment.