Browse Source

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 <martin.renvoize@ptfs-europe.com>
20.05.x
Jonathan Druart 4 years ago
committed by Martin Renvoize
parent
commit
c6b6b0a427
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      installer/data/mysql/updatedatabase.pl

2
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)";

Loading…
Cancel
Save