Bugzilla – Attachment 53600 Details for
Bug 16716
Invalid SQL GROUP BY clauses in GetborCatFromCatType and GetAuthorisedValues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16716: Replaced wrong GROUP BY with DISTINCT
Bug-16716-Replaced-wrong-GROUP-BY-with-DISTINCT.patch (text/plain), 2.14 KB, created by
Jonathan Druart
on 2016-07-21 17:34:27 UTC
(
hide
)
Description:
Bug 16716: Replaced wrong GROUP BY with DISTINCT
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-21 17:34:27 UTC
Size:
2.14 KB
patch
obsolete
>From 56788faf14c37f07f2521069aa00f43a5abd4855 Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Mon, 13 Jun 2016 15:35:56 +1200 >Subject: [PATCH] Bug 16716: Replaced wrong GROUP BY with DISTINCT > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Koha.pm | 5 ++--- > C4/Members.pm | 6 +++--- > 2 files changed, 5 insertions(+), 6 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 7fe07f1..bb35811 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1024,8 +1024,8 @@ sub GetAuthorisedValues { > my @results; > my $dbh = C4::Context->dbh; > my $query = qq{ >- SELECT * >- FROM authorised_values >+ SELECT DISTINCT av.* >+ FROM authorised_values av > }; > $query .= qq{ > LEFT JOIN authorised_values_branches ON ( id = av_id ) >@@ -1043,7 +1043,6 @@ sub GetAuthorisedValues { > if(@where_strings > 0) { > $query .= " WHERE " . join(" AND ", @where_strings); > } >- $query .= " GROUP BY lib"; > $query .= ' ORDER BY category, ' . ( > $opac ? 'COALESCE(lib_opac, lib)' > : 'lib, lib_opac' >diff --git a/C4/Members.pm b/C4/Members.pm >index 63e3f36..53ca664 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1321,7 +1321,7 @@ sub GetborCatFromCatType { > my $dbh = C4::Context->dbh; > > my $request = qq{ >- SELECT categories.categorycode, categories.description >+ SELECT DISTINCT categories.categorycode, categories.description > FROM categories > }; > $request .= qq{ >@@ -1329,9 +1329,9 @@ sub GetborCatFromCatType { > } if $branch_limit; > if($action) { > $request .= " $action "; >- $request .= " AND (branchcode = ? OR branchcode IS NULL) GROUP BY description" if $branch_limit; >+ $request .= " AND (branchcode = ? OR branchcode IS NULL)" if $branch_limit; > } else { >- $request .= " WHERE branchcode = ? OR branchcode IS NULL GROUP BY description" if $branch_limit; >+ $request .= " WHERE branchcode = ? OR branchcode IS NULL" if $branch_limit; > } > $request .= " ORDER BY categorycode"; > >-- >2.8.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 16716
:
52297
|
53567
| 53600