зеркало из https://github.com/mozilla/pjs.git
Updating the vote cache should not update the date-last-changed field
in the bug.
This commit is contained in:
Родитель
20785fe4f0
Коммит
e698ef7799
|
@ -103,7 +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();
|
||||||
SendSQL("update bugs set votes = $v where bug_id = $id");
|
SendSQL("update bugs set votes = $v, delta_ts=delta_ts where bug_id = $id");
|
||||||
}
|
}
|
||||||
SendSQL("unlock tables");
|
SendSQL("unlock tables");
|
||||||
|
|
||||||
|
|
|
@ -535,7 +535,7 @@ sub RemoveVotes {
|
||||||
close SENDMAIL;
|
close SENDMAIL;
|
||||||
}
|
}
|
||||||
SendSQL("delete from votes where bug_id = $id");
|
SendSQL("delete from votes where bug_id = $id");
|
||||||
SendSQL("update bugs set votes = 0 where bug_id = $id");
|
SendSQL("update bugs set votes = 0, delta_ts=delta_ts where bug_id = $id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ PutHeader("Bugzilla Sanity Check");
|
||||||
if (exists $::FORM{'rebuildvotecache'}) {
|
if (exists $::FORM{'rebuildvotecache'}) {
|
||||||
Status("OK, now rebuilding vote cache.");
|
Status("OK, now rebuilding vote cache.");
|
||||||
SendSQL("lock tables bugs write, votes read");
|
SendSQL("lock tables bugs write, votes read");
|
||||||
SendSQL("update bugs set votes = 0");
|
SendSQL("update bugs set votes = 0, delta_ts=delta_ts");
|
||||||
SendSQL("select bug_id, sum(count) from votes group by bug_id");
|
SendSQL("select bug_id, sum(count) from votes group by bug_id");
|
||||||
my %votes;
|
my %votes;
|
||||||
while (@row = FetchSQLData()) {
|
while (@row = FetchSQLData()) {
|
||||||
|
@ -71,10 +71,10 @@ if (exists $::FORM{'rebuildvotecache'}) {
|
||||||
$votes{$id} = $v;
|
$votes{$id} = $v;
|
||||||
}
|
}
|
||||||
foreach my $id (keys %votes) {
|
foreach my $id (keys %votes) {
|
||||||
SendSQL("update bugs set votes = $votes{$id} where bug_id = $id");
|
SendSQL("update bugs set votes = $votes{$id}, delta_ts=delta_ts where bug_id = $id");
|
||||||
}
|
}
|
||||||
SendSQL("unlock tables");
|
SendSQL("unlock tables");
|
||||||
Status("Vote cache has been rebuild.");
|
Status("Vote cache has been rebuilt.");
|
||||||
}
|
}
|
||||||
|
|
||||||
print "OK, now running sanity checks.<P>\n";
|
print "OK, now running sanity checks.<P>\n";
|
||||||
|
|
Загрузка…
Ссылка в новой задаче