From 85699900f95ef469b8107fec7a55f92f4602aab6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Apr 2020 15:03:15 +0200 Subject: [PATCH] Bug 22887: Fix SQL syntax for MySQL 5.5 This does not happen on MySQL 8 or latest MariaDB, but does on MySQL 5.5 "Non-grouping field 'c' is used in HAVING clause" --- installer/data/mysql/updatedatabase.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4590eadc01..eac7f132b8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21577,7 +21577,7 @@ if( CheckVersion( $DBversion ) ) { SELECT category, authorised_value, COUNT(concat(category, ':', authorised_value)) AS c FROM authorised_values GROUP BY category, authorised_value - HAVING c > 1 + HAVING COUNT(concat(category, ':', authorised_value)) > 1 |, { Slice => {} }); if ( @$duplicates ) { push @description, "WARNING - Cannot create unique constraint on authorised_value(category, authorised_value)"; -- 2.20.1