From b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Wed, 16 Mar 2005 08:27:14 +0000 Subject: Bug 174295: ANSI SQL requires all columns in SELECT to be in GROUP BY, unless they are in "aggregate" functions Patch By Tomas Kopal r=joel, a=myk --- Bugzilla/Flag.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Flag.pm') diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index ea60eebe4..7245edbfa 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -567,6 +567,8 @@ sub GetBug { # Returns a hash of information about a target bug. my ($id) = @_; + my $dbh = Bugzilla->dbh; + # Save the currently running query (if any) so we do not overwrite it. &::PushGlobalSQLState(); @@ -574,8 +576,9 @@ sub GetBug { COUNT(bug_group_map.group_id) FROM bugs LEFT JOIN bug_group_map ON (bugs.bug_id = bug_group_map.bug_id) - WHERE bugs.bug_id = $id - GROUP BY bugs.bug_id"); + WHERE bugs.bug_id = $id " . + $dbh->sql_group_by('bugs.bug_id', + 'short_desc, product_id, component_id')); my $bug = { 'id' => $id }; -- cgit v1.2.3-24-g4f1b