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 <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-08 11:46:58 +01:00 committed by Martin Renvoize
parent 0d2cc574d1
commit 5ebf75ecd0
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
7 changed files with 7 additions and 7 deletions

View File

@ -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(

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),