Bugzilla – Attachment 71620 Details for
Bug 20177
Remove GROUP BY clause in GetCourses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20177: [sql_modes] Fix GROUP BY clause in GetCourses
Bug-20177-sqlmodes-Fix-GROUP-BY-clause-in-GetCours.patch (text/plain), 1.64 KB, created by
Jonathan Druart
on 2018-02-14 16:38:54 UTC
(
hide
)
Description:
Bug 20177: [sql_modes] Fix GROUP BY clause in GetCourses
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-14 16:38:54 UTC
Size:
1.64 KB
patch
obsolete
>From 7c5b24d7e14b896e2ef974bc675986efb4a20609 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Feb 2018 18:13:06 -0300 >Subject: [PATCH] Bug 20177: [sql_modes] Fix GROUP BY clause in GetCourses > >Fix for: >'koha_kohadev.courses.department' isn't in GROUP BY > >t/db_dependent/CourseReserves.t > >A better fix would be to remove the joins and only return values from >the courses table. But more work is needed to acchieve that goal. >--- > C4/CourseReserves.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index 3a3f422a96..2b1ef027df 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -162,9 +162,9 @@ sub GetCourses { > my @query_values; > > my $query = " >- SELECT courses.* >- FROM courses >- LEFT JOIN course_reserves ON course_reserves.course_id = courses.course_id >+ SELECT c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp >+ FROM courses c >+ LEFT JOIN course_reserves ON course_reserves.course_id = c.course_id > LEFT JOIN course_items ON course_items.ci_id = course_reserves.ci_id > "; > >@@ -180,7 +180,7 @@ sub GetCourses { > $query .= join( ' AND ', @query_keys ); > } > >- $query .= " GROUP BY courses.course_id "; >+ $query .= " GROUP BY c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp "; > > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare($query); >-- >2.11.0
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 20177
:
71468
|
71620
|
79405
|
80080