From 5ebf75ecd07f99b5d8bb56edc9b1758d262a30c1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 Nov 2019 11:46:58 +0100 Subject: [PATCH] Bug 23997: Escape z3950servers.rank as it's a new MySQL 8 kw This patch will fix installation of Koha on MySQL 8 DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank, syntax, encoding,recordtype) VALUES ('lx2.loc.gov',210,'LCDB','','','LIBRA' at line 2 at /usr/share/perl5/DBIx/RunSQL.pm line 273. https://dev.mysql.com/doc/refman/8.0/en/keywords.html => RANK (R); added in 8.0.2 (reserved) Signed-off-by: Martin Renvoize --- cataloguing/z3950_auth_search.pl | 2 +- installer/data/mysql/de-DE/optional/sample_z3950_servers.sql | 2 +- installer/data/mysql/en/optional/sample_z3950_servers.sql | 2 +- installer/data/mysql/es-ES/optional/sample_z3950_servers.sql | 2 +- installer/data/mysql/fr-CA/facultatif/sample_z3950_servers.sql | 2 +- installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql | 2 +- installer/data/mysql/pl-PL/optional/sample_z3950_servers.sql | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index e4bdadced4..1e25468785 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -68,7 +68,7 @@ $template->param( ); if ( $op ne "do_search" ) { - my $sth = $dbh->prepare("SELECT id,host,servername,checked FROM z3950servers WHERE recordtype = 'authority' ORDER BY rank, servername"); + my $sth = $dbh->prepare("SELECT id,host,servername,checked FROM z3950servers WHERE recordtype = 'authority' ORDER BY `rank`, servername"); $sth->execute(); my $serverloop = $sth->fetchall_arrayref( {} ); $template->param( diff --git a/installer/data/mysql/de-DE/optional/sample_z3950_servers.sql b/installer/data/mysql/de-DE/optional/sample_z3950_servers.sql index ae4e9bc9d7..1168fe12b9 100644 --- a/installer/data/mysql/de-DE/optional/sample_z3950_servers.sql +++ b/installer/data/mysql/de-DE/optional/sample_z3950_servers.sql @@ -1,5 +1,5 @@ INSERT INTO z3950servers -(host, port, db, userid, password, servername, checked, rank, syntax, encoding,recordtype) VALUES +(host, port, db, userid, password, servername, checked, `rank`, syntax, encoding,recordtype) VALUES ('lx2.loc.gov',210,'LCDB','','','LIBRARY OF CONGRESS',1,1,'USMARC','utf8','biblio'), ('lx2.loc.gov',210,'NAF','','','LIBRARY OF CONGRESS NAMES',1,1,'USMARC','utf8','authority'), ('lx2.loc.gov',210,'SAF','','','LIBRARY OF CONGRESS SUBJECTS',1,2,'USMARC','utf8','authority'); diff --git a/installer/data/mysql/en/optional/sample_z3950_servers.sql b/installer/data/mysql/en/optional/sample_z3950_servers.sql index ae4e9bc9d7..1168fe12b9 100644 --- a/installer/data/mysql/en/optional/sample_z3950_servers.sql +++ b/installer/data/mysql/en/optional/sample_z3950_servers.sql @@ -1,5 +1,5 @@ INSERT INTO z3950servers -(host, port, db, userid, password, servername, checked, rank, syntax, encoding,recordtype) VALUES +(host, port, db, userid, password, servername, checked, `rank`, syntax, encoding,recordtype) VALUES ('lx2.loc.gov',210,'LCDB','','','LIBRARY OF CONGRESS',1,1,'USMARC','utf8','biblio'), ('lx2.loc.gov',210,'NAF','','','LIBRARY OF CONGRESS NAMES',1,1,'USMARC','utf8','authority'), ('lx2.loc.gov',210,'SAF','','','LIBRARY OF CONGRESS SUBJECTS',1,2,'USMARC','utf8','authority'); diff --git a/installer/data/mysql/es-ES/optional/sample_z3950_servers.sql b/installer/data/mysql/es-ES/optional/sample_z3950_servers.sql index ae4e9bc9d7..1168fe12b9 100644 --- a/installer/data/mysql/es-ES/optional/sample_z3950_servers.sql +++ b/installer/data/mysql/es-ES/optional/sample_z3950_servers.sql @@ -1,5 +1,5 @@ INSERT INTO z3950servers -(host, port, db, userid, password, servername, checked, rank, syntax, encoding,recordtype) VALUES +(host, port, db, userid, password, servername, checked, `rank`, syntax, encoding,recordtype) VALUES ('lx2.loc.gov',210,'LCDB','','','LIBRARY OF CONGRESS',1,1,'USMARC','utf8','biblio'), ('lx2.loc.gov',210,'NAF','','','LIBRARY OF CONGRESS NAMES',1,1,'USMARC','utf8','authority'), ('lx2.loc.gov',210,'SAF','','','LIBRARY OF CONGRESS SUBJECTS',1,2,'USMARC','utf8','authority'); diff --git a/installer/data/mysql/fr-CA/facultatif/sample_z3950_servers.sql b/installer/data/mysql/fr-CA/facultatif/sample_z3950_servers.sql index bea0a400ff..587b7e1523 100644 --- a/installer/data/mysql/fr-CA/facultatif/sample_z3950_servers.sql +++ b/installer/data/mysql/fr-CA/facultatif/sample_z3950_servers.sql @@ -1,5 +1,5 @@ INSERT INTO z3950servers -(host, port, db, userid, password, servername, checked, rank, syntax, encoding,recordtype) VALUES +(host, port, db, userid, password, servername, checked, `rank`, syntax, encoding,recordtype) VALUES ('lx2.loc.gov',210,'LCDB','','','Bibliothèque du congrès',1,1,'USMARC','utf8','biblio'), ('lx2.loc.gov',210,'NAF','','','Bibliothèque du congrès NOMS',1,1,'USMARC','utf8','authority'), ('lx2.loc.gov',210,'SAF','','','Bibliothèque du congrès SUJETS',1,2,'USMARC','utf8','authority'), diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql b/installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql index 9b303a11b6..3862640d7c 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql @@ -1,4 +1,4 @@ -INSERT INTO z3950servers (host, port, db, userid, password, servername, id, checked, rank, syntax, timeout, servertype, encoding) VALUES +INSERT INTO z3950servers (host, port, db, userid, password, servername, id, checked, `rank`, syntax, timeout, servertype, encoding) VALUES ('lx2.loc.gov',210,'LCDB','','','LIBRARY OF CONGRESS',1,0,0,'USMARC',0,'zed','utf8'), ('z3950.bibsys.no',2100,'BIBSYS','','','BIBSYS',12,1,1,'NORMARC',0,'zed','ISO_8859-1'), ('z3950.nb.no',2100,'Norbok','','','NORBOK',13,0,0,'NORMARC',0,'zed','ISO_8859-1'), diff --git a/installer/data/mysql/pl-PL/optional/sample_z3950_servers.sql b/installer/data/mysql/pl-PL/optional/sample_z3950_servers.sql index a6a2f1a880..aff740c313 100644 --- a/installer/data/mysql/pl-PL/optional/sample_z3950_servers.sql +++ b/installer/data/mysql/pl-PL/optional/sample_z3950_servers.sql @@ -1,5 +1,5 @@ INSERT INTO z3950servers -(host, port, db, userid, password, servername, checked, rank, syntax, encoding,recordtype) VALUES +(host, port, db, userid, password, servername, checked, `rank`, syntax, encoding,recordtype) VALUES ('alpha.bn.org.pl',210,'INNOPAC','','','BIBLIOTEKA NARODOWA',1,1,'MARC21','utf8', 'biblio'), ('lx2.loc.gov',210,'LCDB','','','LIBRARY OF CONGRESS',1,1,'USMARC','utf8','biblio'), ('lx2.loc.gov',210,'NAF','','','LIBRARY OF CONGRESS NAMES',1,1,'USMARC','utf8','authority'), -- 2.39.5