From 2c40ef6bd4c869637d628f5c72f0b887d2fea997 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Tue, 28 Nov 2017 21:44:40 -0500 Subject: [PATCH] CRM-21455 supportsFullGroupBy: MariaDB 10.2 does not support ANY_VALUE --- CRM/Utils/SQL.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/SQL.php b/CRM/Utils/SQL.php index fb4c41273b..e855f20dea 100644 --- a/CRM/Utils/SQL.php +++ b/CRM/Utils/SQL.php @@ -69,11 +69,22 @@ class CRM_Utils_SQL { } /** - * Does this System support the MYSQL mode ONLY_FULL_GROUP_BY + * Checks if this system enforce the MYSQL mode ONLY_FULL_GROUP_BY. + * This function should be named supportsAnyValueAndEnforcesFullGroupBY(), + * but should be deprecated instead. + * * @return mixed + * @deprecated */ public static function supportsFullGroupBy() { - return version_compare(CRM_Core_DAO::singleValueQuery('SELECT VERSION()'), '5.7', '>='); + // CRM-21455 MariaDB 10.2 does not support ANY_VALUE + $version = CRM_Core_DAO::singleValueQuery('SELECT VERSION()'); + + if (stripos('mariadb', $version) !== NULL) { + return FALSE; + } + + return version_compare($version, '5.7', '>='); } /** -- 2.25.1