From: Tim Düsterhus Date: Mon, 11 Feb 2019 11:01:06 +0000 (+0100) Subject: Update sql_mode to use with MySQL X-Git-Tag: 5.2.0_Alpha_1~297 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a8c04261610eac36d92f794541c4bb6f43456695;p=GitHub%2FWoltLab%2FWCF.git Update sql_mode to use with MySQL Add: - NO_ZERO_IN_DATE - ERROR_FOR_DIVISION_BY_ZERO - NO_ENGINE_SUBSTITUTION Closes #2827 --- diff --git a/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php b/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php index 5cc07591e3..0894980730 100644 --- a/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php +++ b/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php @@ -29,7 +29,7 @@ class MySQLDatabase extends Database { ]; if (!$this->failsafeTest) { $driverOptions = [ - \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8mb4', SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES'" + \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8mb4', SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'" ]; }