Bugzilla – Attachment 122394 Details for
Bug 28524
Most-circulated items (cat_issues_top.pl) is failing with MySQL 8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28524: Escape 'rank' in cat_issues_top.pl
Bug-28524-Escape-rank-in-catissuestoppl.patch (text/plain), 1.75 KB, created by
Owen Leonard
on 2021-06-24 16:41:19 UTC
(
hide
)
Description:
Bug 28524: Escape 'rank' in cat_issues_top.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-06-24 16:41:19 UTC
Size:
1.75 KB
patch
obsolete
>From d6577c8f400cb3ae23208c08b7d7d8ad35112e5d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 16 Jun 2021 14:51:08 +0200 >Subject: [PATCH] Bug 28524: Escape 'rank' in cat_issues_top.pl > >It's a MySQL 8 keyword > >Test plan: >Turn off strict_sql_modes (there are other problems in this script) >Hit Home Reports > Most-circulated items >Submit the form > >Without this patch you got: > 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, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, > ccode as CCODE, loca' at line 1 > >With this patch applied you see the report result view > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > reports/cat_issues_top.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl >index 93210811f6..040280dbee 100755 >--- a/reports/cat_issues_top.pl >+++ b/reports/cat_issues_top.pl >@@ -297,7 +297,7 @@ sub calculate { > my $strcalc ; > > # Processing average loanperiods >- $strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS RANK, biblio.biblionumber AS ID"; >+ $strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID"; > $strcalc .= ", itemcallnumber as CALLNUM"; > $strcalc .= ", ccode as CCODE"; > $strcalc .= ", location as LOC"; >@@ -345,7 +345,7 @@ sub calculate { > > $strcalc .= " group by biblio.biblionumber"; > $strcalc .= ", $colfield" if ($column); >- $strcalc .= " order by RANK DESC"; >+ $strcalc .= " order by `RANK` DESC"; > $strcalc .= ", $colfield " if ($colfield); > > my $dbcalc = $dbh->prepare($strcalc); >-- >2.20.1
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 28524
:
122036
|
122394
|
122416