Bugzilla – Attachment 169703 Details for
Bug 37476
RANK is a reserved word in MySQL 8.0.2+
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37476: Fix reserved word error on Serials.pm on MySQL 8
Bug-37476-Fix-reserved-word-error-on-Serialspm-on-.patch (text/plain), 1.74 KB, created by
Emily Lamancusa (emlam)
on 2024-07-26 13:19:42 UTC
(
hide
)
Description:
Bug 37476: Fix reserved word error on Serials.pm on MySQL 8
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2024-07-26 13:19:42 UTC
Size:
1.74 KB
patch
obsolete
>From 8808a04eb59845fe159f7cae70c040aec0e20cca Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 25 Jul 2024 13:29:42 -0300 >Subject: [PATCH] Bug 37476: Fix reserved word error on Serials.pm on MySQL 8 > >This patch fixes the fact `RANK` become a reserved word in MySQL 8.0.2 >[1] > >To test: >1. Launch KTD with MySQL 8: > $ ktd down > $ DB_IMAGE=mysql:8 ktd up -d >2. Open the logs > $ ktd --shell > k$ tail -f /var/log/koha/kohadev/*.log >3. Create a serial, receive an issue and try to create a routing list >4. Click on `+ Add recipients` and look for Henry >5. Click `Add` and then `Close` >=> FAIL: Henry not added >=> FAIL: The logs show an error about wrong SQL syntax >6. Run: > k$ prove t/db_dependent/Serials.t >=> FAIL: Tests explode with the same kind of error! >6. Apply this patch >7. Restart plack >8. Repeat 3 through 6 >=> SUCCESS: Henry added! >=> SUCCESS: No explosion about the SQL syntax in the logs >=> SUCCESS: Tests pass! >9. Sign off :-D > >[1] https://dev.mysql.com/doc/refman/8.0/en/keywords.html > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > C4/Serials.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 79a3a70dbd..3298b06cd9 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -2023,7 +2023,7 @@ sub addroutingmember { > > my $rank; > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( "SELECT max(ranking) rank FROM subscriptionroutinglist WHERE subscriptionid = ?" ); >+ my $sth = $dbh->prepare( "SELECT max(ranking) `rank` FROM subscriptionroutinglist WHERE subscriptionid = ?" ); > $sth->execute($subscriptionid); > while ( my $line = $sth->fetchrow_hashref ) { > if ( defined $line->{rank} && $line->{rank} > 0 ) { >-- >2.34.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 37476
:
169609
|
169610
|
169702
|
169703
|
169722
|
169723