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 --- request.cgi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'request.cgi') diff --git a/request.cgi b/request.cgi index fa37344e2..7f3e6351c 100755 --- a/request.cgi +++ b/request.cgi @@ -206,8 +206,15 @@ sub queue { # Group the records by flag ID so we don't get multiple rows of data # for each flag. This is only necessary because of the code that # removes flags on bugs the user is unauthorized to access. - $query .= " GROUP BY flags.id " . - "HAVING cntuseringroups = cntbugingroups OR canseeanyway "; + $query .= ' ' . $dbh->sql_group_by('flags.id', + 'flagtypes.name, flags.status, flags.bug_id, bugs.short_desc, + products.name, components.name, flags.attach_id, + attachments.description, requesters.realname, + requesters.login_name, requestees.realname, + requestees.login_name, flags.creation_date, + cclist_accessible, bugs.reporter, bugs.reporter_accessible, + bugs.assigned_to'); + $query .= " HAVING cntuseringroups = cntbugingroups OR canseeanyway "; # Group the records, in other words order them by the group column # so the loop in the display template can break them up into separate -- cgit v1.2.3-24-g4f1b