diff options
author | mkanat%kerio.com <> | 2005-03-16 09:27:14 +0100 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-03-16 09:27:14 +0100 |
commit | b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb (patch) | |
tree | b2769bdde9c44eefd7834dcbc18e67e66d6d1aa9 /sanitycheck.cgi | |
parent | 94dcd5edee079a1bb67a0011711d25a4be0f14c6 (diff) | |
download | bugzilla-b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb.tar.gz bugzilla-b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb.tar.xz |
Bug 174295: ANSI SQL requires all columns in SELECT to be in GROUP BY, unless they are in "aggregate" functions
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=joel, a=myk
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-x | sanitycheck.cgi | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 6f85e6cfd..84f41c398 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -102,7 +102,8 @@ if (defined $cgi->param('rebuildvotecache')) { Status("OK, now rebuilding vote cache."); $dbh->bz_lock_tables('bugs WRITE', 'votes READ'); SendSQL("UPDATE bugs SET votes = 0"); - SendSQL("SELECT bug_id, SUM(vote_count) FROM votes GROUP BY bug_id"); + SendSQL("SELECT bug_id, SUM(vote_count) FROM votes " . + $dbh->sql_group_by('bug_id')); my %votes; while (@row = FetchSQLData()) { my ($id, $v) = (@row); @@ -482,7 +483,8 @@ while (@row = FetchSQLData()) { } Status("Checking cached vote counts"); -SendSQL("SELECT bug_id, SUM(vote_count) FROM votes GROUP BY bug_id"); +SendSQL("SELECT bug_id, SUM(vote_count) FROM votes " . + $dbh->sql_group_by('bug_id')); while (@row = FetchSQLData()) { my ($id, $v) = (@row); |