CRM-21771: error when viewing event registration with linked contribution
[civicrm-core.git] / CRM / Utils / SQL.php
index fb4c41273b068f0113ef6d6618be366dbcd65310..dba0c9ebe82c11716372070d138222e07af30a7a 100644 (file)
@@ -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($version, 'mariadb') !== FALSE) {
+      return FALSE;
+    }
+
+    return version_compare($version, '5.7', '>=');
   }
 
   /**