From c6b6b0a42746bd19653216e607ed048846aaab5b 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" Signed-off-by: Martin Renvoize --- 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 bce4964905..e7babbdcdd 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.39.5