From fab74d82dcc0c32ab52c12f53221340e2d3de608 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Wed, 26 Aug 2020 10:16:10 +0200 Subject: [PATCH] Disable ONLY_FULL_GROUP_BY mode for db connection [MAILPOET-3115] --- lib/Doctrine/ConnectionFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Doctrine/ConnectionFactory.php b/lib/Doctrine/ConnectionFactory.php index 8e97d817ca..351e6c90d3 100644 --- a/lib/Doctrine/ConnectionFactory.php +++ b/lib/Doctrine/ConnectionFactory.php @@ -55,6 +55,7 @@ class ConnectionFactory { private function getDriverOptions($timezoneOffset, $charset, $collation) { $driverOptions = [ "@@session.time_zone = '$timezoneOffset'", + '@@session.sql_mode = REPLACE(@@sql_mode, "ONLY_FULL_GROUP_BY", "")', // This is needed because ONLY_FULL_GROUP_BY mode in MariaDB is much more restrictive than in MySQL // We need to use CONVERT for MySQL 8, Maria DB bug which triggers #1232 - Incorrect argument type to variable 'wait_timeout` // https://stackoverflow.com/questions/35187378/mariadb-type-error-when-setting-session-variable "@@session.wait_timeout = GREATEST(CONVERT(COALESCE(@@wait_timeout, 0), SIGNED), $this->minWaitTimeout)",