Bug 29973 - SQL syntax error in Cataloging when accessing pages "Advanced editor" and "New record"
Summary: SQL syntax error in Cataloging when accessing pages "Advanced editor" and "Ne...
Status: RESOLVED DUPLICATE of bug 33375
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 21.11
Hardware: All Linux
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-28 21:26 UTC by Dave Hodgins
Modified: 2023-06-25 11:43 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hodgins 2022-01-28 21:26:54 UTC
Recently upgraded to 21.11.01 and the "Advanced editor" page https://chnc-koha-intra.domain/cgi-bin/koha/cataloguing/editor.pl now returns Error 500. The intranet-error.log reports the following SQL syntax error:

AH01215: {UNKNOWN}: DBI Exception: DBD::mysql::db selectall_arrayref 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 ',servername' at line 3  at /usr/share/perl5/DBIx/Class/Schema.pm line 1118.: /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl

AH01215: \tDBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x561f387caed8), "DBI Exception: DBD::mysql::db selectall_arrayref failed: You "...) called at /usr/share/perl5/DBIx/Class/Storage.pm line 113: /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl

AH01215: \tDBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(0x561f389880d8), "DBI Exception: DBD::mysql::db selectall_arrayref failed: You "...) called at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1501: /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl

AH01215: \tDBIx::Class::Storage::DBI::__ANON__("DBD::mysql::db selectall_arrayref failed: You have an error i"..., DBI::db=HASH(0x561f3a9a8f90), undef) called at /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl line 80: /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl

AH01215: : /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl

Koha 21.11.01.000
MySQL 8.0.27
Comment 1 Dave Hodgins 2022-01-31 16:59:51 UTC
The problem is in file /usr/share/koha/intranet/cgi-bin/cataloguing/editor.pl. You've got a hard coded SQL statement that uses the MySQL (as of version 8, anyway) reserved keyword "rank." Escaping that seems to fix the issue.
Comment 2 Katrin Fischer 2022-02-19 21:03:25 UTC
Raising severity for now to get some attention on this.
Comment 3 Katrin Fischer 2023-06-25 11:43:08 UTC
This was fixed by bug 33375.

*** This bug has been marked as a duplicate of bug 33375 ***