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 --- editusers.cgi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'editusers.cgi') diff --git a/editusers.cgi b/editusers.cgi index 82ad50bcf..f72866982 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -682,6 +682,7 @@ sub userDataToVars { my $userid = shift; my $user = new Bugzilla::User($userid); my $query; + my $dbh = Bugzilla->dbh; $user->derive_groups(); @@ -717,8 +718,7 @@ sub userDataToVars { AND directbless.user_id = ? AND directbless.isbless = 1 AND directbless.grant_type = ? - GROUP BY id - }, + } . $dbh->sql_group_by('id'), 'id', undef, ($userid, GRANT_DIRECT, $userid, GRANT_REGEXP, @@ -733,8 +733,7 @@ sub userDataToVars { AND ggm.member_id = ugm.group_id AND ugm.isbless = 0 AND ggm.grant_type = ? - GROUP BY id - }; + } . $dbh->sql_group_by('id'); foreach (@{$dbh->selectall_arrayref($query, undef, ($userid, GROUP_BLESS))}) { # Merge indirect bless permissions into permission variable. $vars->{'permissions'}{${$_}[0]}{'indirectbless'} = 1; -- cgit v1.2.3-24-g4f1b