Update sql_mode to use with MySQL
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 11 Feb 2019 11:01:06 +0000 (12:01 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 11 Feb 2019 11:01:06 +0000 (12:01 +0100)
Add:
- NO_ZERO_IN_DATE
- ERROR_FOR_DIVISION_BY_ZERO
- NO_ENGINE_SUBSTITUTION

Closes #2827

wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php

index 5cc07591e3aa0eb67f0e3c6c93478f7f4046db7b..0894980730d071839c0f6e8173af1b6544307812 100644 (file)
@@ -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'"
                                ];
                        }