Bugzilla – Attachment 92613 Details for
Bug 23289
Label Template - Creation not working (MariaDB >= 10.2.4)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23289: Quote new 'rows' MariaDB reserved word
Bug-23289-Quote-new-rows-MariaDB-reserved-word.patch (text/plain), 1.95 KB, created by
Marcel de Rooy
on 2019-09-06 05:49:44 UTC
(
hide
)
Description:
Bug 23289: Quote new 'rows' MariaDB reserved word
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-09-06 05:49:44 UTC
Size:
1.95 KB
patch
obsolete
>From 1ff5131b86deb58a0047467d952c307c687d0612 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 1 Sep 2019 15:26:02 -0400 >Subject: [PATCH] Bug 23289: Quote new 'rows' MariaDB reserved word >Content-Type: text/plain; charset=utf-8 > >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> >--- > C4/Creators/Template.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Creators/Template.pm b/C4/Creators/Template.pm >index ee504d7308..fe876f7a82 100644 >--- a/C4/Creators/Template.pm >+++ b/C4/Creators/Template.pm >@@ -166,7 +166,7 @@ sub save { > foreach my $key (keys %{$self}) { > next if ($key eq 'template_id') || ($key eq 'template_stat') || ($key eq 'creator'); > push (@params, $self->{$key}); >- $query .= "$key=?, "; >+ $query .= "`$key`=?, "; > } > $query = substr($query, 0, (length($query)-2)); > push (@params, $self->{'template_id'}, $self->{'creator'}); >@@ -186,7 +186,7 @@ sub save { > foreach my $key (keys %{$self}) { > next if $key eq 'template_stat'; > push (@params, $self->{$key}); >- $query .= "$key, "; >+ $query .= "`$key`, "; > } > $query = substr($query, 0, (length($query)-2)); > $query .= ") VALUES ("; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23289
:
92520
|
92528
| 92613