Bugzilla – Attachment 48363 Details for
Bug 15877
C4::Barcodes does not correctly calculate db_max for 'annual' barcodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15877 - C4::Barcodes does not correctly calculate db_max for 'annual' barcodes
Bug-15877---C4Barcodes-does-not-correctly-calculat.patch (text/plain), 1.16 KB, created by
Nick Clemens
on 2016-02-24 17:12:18 UTC
(
hide
)
Description:
Bug 15877 - C4::Barcodes does not correctly calculate db_max for 'annual' barcodes
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2016-02-24 17:12:18 UTC
Size:
1.16 KB
patch
obsolete
>From 59c3c8663b73899ccde3f9025626ae04a20486a8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 24 Feb 2016 17:10:02 +0000 >Subject: [PATCH] Bug 15877 - C4::Barcodes does not correctly calculate db_max > for 'annual' barcodes > >This patch alters the MySQL query to remove a max statement which >incorrectly groups full annual barcodes with numeric values. >--- > C4/Barcodes/annual.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Barcodes/annual.pm b/C4/Barcodes/annual.pm >index c2e8d0b..74346dd 100644 >--- a/C4/Barcodes/annual.pm >+++ b/C4/Barcodes/annual.pm >@@ -39,8 +39,8 @@ BEGIN { > > sub db_max ($;$) { > my $self = shift; >- my $query = "SELECT max(substring_index(barcode,'-',-1)) AS chunk,barcode FROM items WHERE barcode LIKE ? GROUP BY barcode"; >- # FIXME: unreasonably expensive query on large datasets >+ my $query = "SELECT substring_index(barcode,'-',-1) AS chunk,barcode FROM items WHERE barcode LIKE ? ORDER BY chunk DESC LIMIT 1"; >+ # FIXME: unreasonably expensive query on large datasets (I think removal of group by does this?) > my $sth = C4::Context->dbh->prepare($query); > my ($iso); > if (@_) { >-- >2.1.4
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 15877
:
48363
|
48365
|
48367
|
49197
|
49198
|
49600
|
49926
|
49927
|
49928
|
49961
|
49962