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 --- editkeywords.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'editkeywords.cgi') diff --git a/editkeywords.cgi b/editkeywords.cgi index f5fcf6a57..8ad74710e 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -30,6 +30,7 @@ use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::User; my $cgi = Bugzilla->cgi; +my $dbh = Bugzilla->dbh; use vars qw($template $vars); @@ -70,8 +71,10 @@ if ($action eq "") { SendSQL("SELECT keyworddefs.id, keyworddefs.name, keyworddefs.description, COUNT(keywords.bug_id) - FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid - GROUP BY keyworddefs.id + FROM keyworddefs LEFT JOIN keywords + ON keyworddefs.id = keywords.keywordid " . + $dbh->sql_group_by('keyworddefs.id', + 'keyworddefs.name, keyworddefs.description') . " ORDER BY keyworddefs.name"); while (MoreSQLData()) { -- cgit v1.2.3-24-g4f1b