diff --git a/api/src/Db/Pdo.php b/api/src/Db/Pdo.php index 6c3f40776c..2b596e1945 100644 --- a/api/src/Db/Pdo.php +++ b/api/src/Db/Pdo.php @@ -104,6 +104,11 @@ class Pdo { case 'mysql': $dsn .= ';charset=utf8'; + // switch off MySQL 5.7+ ONLY_FULL_GROUP_BY sql_mode + if ($egw_db->ServerInfo['version'] >= 5.7 && $egw_db->ServerInfo['version'] < 10.0) + { + $query = "SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))"; + } break; case 'pgsql': $query = "SET NAMES 'utf-8'";