From f4dc9ebc3be2aac10c4e352513370ffcae9391e9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 27 Jun 2016 20:26:48 +0200 Subject: [PATCH] * MySQL/Ubuntu 16.04: switch off sql_mode ONLY_FULL_GROUP_BY enabled in MySQL 5.7+ --- api/src/Db.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Db.php b/api/src/Db.php index 86a62b1ec9..d7a19e9e56 100644 --- a/api/src/Db.php +++ b/api/src/Db.php @@ -524,6 +524,12 @@ class Db { $this->ServerInfo = $this->Link_ID->ServerInfo(); $this->set_capabilities($Type,$this->ServerInfo['version']); + + // switch off MySQL 5.7+ ONLY_FULL_GROUP_BY sql_mode + if (substr($this->Type, 0, 5) == 'mysql' && $this->ServerInfo['version'] > 5.7 && $this->ServerInfo['version'] < 10.0) + { + $this->query("SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))", __LINE__, __FILE__); + } } if (!$Ok) {