diff options
author | terry%mozilla.org <> | 1999-10-12 02:14:30 +0200 |
---|---|---|
committer | terry%mozilla.org <> | 1999-10-12 02:14:30 +0200 |
commit | 73627e594d61e4606b57880cb35bdc50efb3e900 (patch) | |
tree | 329975a02b727ff925fdf1b4aae13b942bd2014c /buglist.cgi | |
parent | 76965a12c5f49e9a6bf99ea0f2d88ba0852bab3d (diff) | |
download | bugzilla-73627e594d61e4606b57880cb35bdc50efb3e900.tar.gz bugzilla-73627e594d61e4606b57880cb35bdc50efb3e900.tar.xz |
Added a "votes" field to the bugs table, which caches the total number
of votes that have been cast for that bug. This let me simplify the
SQL in buglist.cgi, which makes things more efficient and fixes
several strange bugs.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/buglist.cgi b/buglist.cgi index f712f0b3e..6b8ae1446 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -173,7 +173,7 @@ DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version"); DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys"); DefCol("target_milestone", "bugs.target_milestone", "TargetM", "bugs.target_milestone"); -DefCol("votes", "sum(votes.count) as votesum", "Votes", "votesum"); +DefCol("votes", "bugs.votes", "Votes", "bugs.votes"); my @collist; if (defined $::COOKIE{'COLUMNLIST'}) { @@ -229,7 +229,7 @@ bugs.bug_status"; $query .= " -from bugs left join votes on bugs.bug_id = votes.bug_id, +from bugs, profiles assign, profiles report left join profiles qacont on bugs.qa_contact = qacont.userid, @@ -248,7 +248,7 @@ if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) || # We need to poke into the CC table. Do weird SQL left join stuff so that # we can look in the CC table, but won't reject any bugs that don't have # any CC fields. - $query =~ s/bugs left join/bugs left join cc on bugs.bug_id = cc.bug_id left join profiles ccname on cc.who = ccname.userid left join/; + $query =~ s/bugs,/bugs left join cc on bugs.bug_id = cc.bug_id left join profiles ccname on cc.who = ccname.userid,/; } if (defined $::FORM{'sql'}) { @@ -366,6 +366,10 @@ if (defined $::FORM{'changedin'}) { } } +if (defined $minvotes) { + $query .= "and votes >= $minvotes "; +} + my $ref = $::MFORM{'chfield'}; @@ -407,7 +411,7 @@ if (defined $ref) { if (defined $ref && 0 < @$ref) { # Do surgery on the query to tell it to patch in the bugs_activity # table. - $query =~ s/profiles assign,/profiles assign, bugs_activity,/; + $query =~ s/bugs,/bugs, bugs_activity,/; my @list; foreach my $f (@$ref) { @@ -552,11 +556,6 @@ while (@row = FetchSQLData()) { # the same group. If they don't, we leave # it alone. } - if (defined $minvotes) { - if ($row[$votecolnum] < $minvotes) { - next; - } - } if (!defined $seen{$bug_id}) { $seen{$bug_id} = 1; $count++; |