Bugzilla – Attachment 71432 Details for
Bug 20144
Test suite is failing with new default SQL modes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20144: [sql_modes] Remove HAVING clause in GetUpcomingDueIssues
Bug-20144-sqlmodes-Remove-HAVING-clause-in-GetUpco.patch (text/plain), 1.56 KB, created by
Julian Maurice
on 2018-02-12 10:40:43 UTC
(
hide
)
Description:
Bug 20144: [sql_modes] Remove HAVING clause in GetUpcomingDueIssues
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-12 10:40:43 UTC
Size:
1.56 KB
patch
obsolete
>From e343e4539fbefa2496d46ac2735f6980a77660ed Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Feb 2018 18:08:03 -0300 >Subject: [PATCH] Bug 20144: [sql_modes] Remove HAVING clause in > GetUpcomingDueIssues > >More attention needed here! > >Fix for: >Non-grouping field 'days_until_due' is used in HAVING clause > >t/db_dependent/Circulation.t > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > C4/Circulation.pm | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 2b7722c429..75215db2e2 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2553,12 +2553,15 @@ sub GetUpcomingDueIssues { > my $dbh = C4::Context->dbh; > > my $statement = <<END_SQL; >-SELECT issues.*, items.itype as itemtype, items.homebranch, TO_DAYS( date_due )-TO_DAYS( NOW() ) as days_until_due, branches.branchemail >-FROM issues >-LEFT JOIN items USING (itemnumber) >-LEFT OUTER JOIN branches USING (branchcode) >-WHERE returndate is NULL >-HAVING days_until_due >= 0 AND days_until_due <= ? >+SELECT * >+FROM ( >+ SELECT issues.*, items.itype as itemtype, items.homebranch, TO_DAYS( date_due )-TO_DAYS( NOW() ) as days_until_due, branches.branchemail >+ FROM issues >+ LEFT JOIN items USING (itemnumber) >+ LEFT OUTER JOIN branches USING (branchcode) >+ WHERE returndate is NULL >+) tmp >+WHERE days_until_due >= 0 AND days_until_due <= ? > END_SQL > > my @bind_parameters = ( $params->{'days_in_advance'} ); >-- >2.14.2
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 20144
:
71410
|
71411
|
71412
|
71413
|
71414
|
71415
|
71416
|
71417
|
71418
|
71419
|
71420
|
71421
|
71422
|
71423
|
71424
|
71425
|
71427
|
71428
|
71429
|
71430
|
71431
| 71432 |
71434
|
71435
|
71436
|
71437
|
71438
|
71440
|
71441
|
71442
|
71443
|
71444
|
71445
|
71446
|
71447
|
71448
|
71449
|
71450
|
71451
|
71452
|
71453
|
71454
|
71455
|
71456
|
71457
|
71458
|
71459
|
71460
|
71461
|
71462
|
71463
|
71467
|
71564