Hi, Create a "Label Template" and save. (any configuration ....) There is no error message. But it shows a message indicating that "there is no template". The error log shows the following: label-edit-template.pl: Database returned the following error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, page_height, label_width, label_height) VALUES ('0','Labels','0','0','0','' at line 1 at /usr/share/koha/lib/C4/Creators/Template.pm line 201.: /usr/share/koha/intranet/cgi-bin/labels/label-edit-template.pl Koha version: 19.0501000 MariaDB: 10.3.15 Could you verify it, please. Thanks in advance Andre
Hi Andre, it's working for me on master. Did you change/add anything in the form?
Hi Katrin, I changed nothing. It is just a new installation on Debian 10.
Is it possible you are running MariaDB in strict mode? It should be off by default, but depending on how you installed or changed it could be a reason (https://wiki.koha-community.org/wiki/SQL_modes) Running a bit out of ideas, it might be worth bringing this up on the koha-devel mailing list as more people will read it there.
You are right. MariaDB seems to be running in strict mode, but this is as default since 10.2.4 https://mariadb.com/kb/en/library/sql-mode/#strict-mode After a standard Debian 10 installation (no changes on default) and following these sites: https://wiki.koha-community.org/wiki/Preparing_your_system https://wiki.koha-community.org/wiki/Koha_on_Debian I installed MariaDB as descriped under "Install the Database" The error is only for the "lable template", the printer profile and layouts are working.
Dropping the severity a bit, still an issue though.
I'm not sure that the SQL mode is the problem per se; rather, as of 10.2.4, "rows" is now a reserved word in MariaDB and cannot be used as a identifier (e.g., a column name) without quoting it. Using backticks to quote the word in the insert statement would make it work, but of course that violates the SQL6 guideline (though given commit fd30cac85, perhaps that guideline isn't being enforced?). It doesn't look like ANSI_QUOTES or ANSI are being set either. Renaming label_templates.rows column is another option, of course.
Created attachment 92520 [details] [review] Bug 23289: Quote new 'rows' MariaDB reserved word Since MariaDB 10.2.4 rows is a reserved word: https://mariadb.com/kb/en/library/mariadb-1024-release-notes/ """ New reserved word: ROWS. This can no longer be used as an identifier without being quoted. """ Test plan: With MariaDB >= 10.2.4, create a new label template. Also, prove t/db_dependent/Labels/t_Template.t Without this patch you will get the following SQL error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, creator, template_code, page_height,
Created attachment 92528 [details] [review] Bug 23289: Quote new 'rows' MariaDB reserved word Since MariaDB 10.2.4 rows is a reserved word: https://mariadb.com/kb/en/library/mariadb-1024-release-notes/ """ New reserved word: ROWS. This can no longer be used as an identifier without being quoted. """ Test plan: With MariaDB >= 10.2.4, create a new label template. Also, prove t/db_dependent/Labels/t_Template.t Without this patch you will get the following SQL error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, creator, template_code, page_height, Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 92613 [details] [review] Bug 23289: Quote new 'rows' MariaDB reserved word Since MariaDB 10.2.4 rows is a reserved word: https://mariadb.com/kb/en/library/mariadb-1024-release-notes/ """ New reserved word: ROWS. This can no longer be used as an identifier without being quoted. """ Test plan: With MariaDB >= 10.2.4, create a new label template. Also, prove t/db_dependent/Labels/t_Template.t Without this patch you will get the following SQL error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, creator, template_code, page_height, Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.04
*** Bug 23960 has been marked as a duplicate of this bug. ***