Bugzilla – Attachment 122395 Details for
Bug 28523
Patrons with the most checkouts (bor_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 28523: Escape 'rank' in bor_issues_top.pl
Bug-28523-Escape-rank-in-borissuestoppl.patch (text/plain), 1.82 KB, created by
Owen Leonard
on 2021-06-24 16:44:39 UTC
(
hide
)
Description:
Bug 28523: Escape 'rank' in bor_issues_top.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-06-24 16:44:39 UTC
Size:
1.82 KB
patch
obsolete
>From 48a9ba46fd3a39dbed3f457dec60e72eee3cc73e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 16 Jun 2021 14:54:47 +0200 >Subject: [PATCH] Bug 28523: Escape 'rank' in bor_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 > Patrons with the most checkouts >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, borrowers.borrowernumber AS ID FROM `old_issues` > >With this patch applied you see the report result view > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > reports/bor_issues_top.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl >index 53d7966b98..6737c03970 100755 >--- a/reports/bor_issues_top.pl >+++ b/reports/bor_issues_top.pl >@@ -240,7 +240,7 @@ sub calculate { > my $strcalc ; > > # Processing average loanperiods >- $strcalc .= "SELECT CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname), COUNT(*) AS RANK, borrowers.borrowernumber AS ID"; >+ $strcalc .= "SELECT CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname), COUNT(*) AS `RANK`, borrowers.borrowernumber AS ID"; > $strcalc .= " , $colfield " if ($colfield); > $strcalc .= " FROM `old_issues` > LEFT JOIN borrowers USING(borrowernumber) >@@ -265,7 +265,7 @@ sub calculate { > } > $strcalc .= " GROUP BY borrowers.borrowernumber"; > $strcalc .= ", $colfield" if ($column); >- $strcalc .= " ORDER BY RANK DESC"; >+ $strcalc .= " ORDER BY `RANK` DESC"; > $strcalc .= ",$colfield " if ($colfield); > $strcalc .= " LIMIT $limit" if ($limit); > >-- >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 28523
:
122037
|
122395
|
122417