Commit ea61ebd4 authored by terry%mozilla.org's avatar terry%mozilla.org

Removing the last vote on a bug was causing an SQL error.

parent e18c6fd4
...@@ -103,6 +103,7 @@ foreach my $id (@buglist) { ...@@ -103,6 +103,7 @@ foreach my $id (@buglist) {
foreach my $id (keys %affected) { foreach my $id (keys %affected) {
SendSQL("select sum(count) from votes where bug_id = $id"); SendSQL("select sum(count) from votes where bug_id = $id");
my $v = FetchOneColumn(); my $v = FetchOneColumn();
$v ||= 0;
SendSQL("update bugs set votes = $v, delta_ts=delta_ts where bug_id = $id"); SendSQL("update bugs set votes = $v, delta_ts=delta_ts where bug_id = $id");
} }
SendSQL("unlock tables"); SendSQL("unlock tables");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment