From b1779f28a5f15f7ad39855e07a27fcda19b8d3f1 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 17 Apr 2012 02:13:34 +0200 Subject: Bug 745080: Voting extension causes database deadlocks r=glob a=LpSolit --- extensions/Voting/Extension.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extensions') diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index 43c5821a7..b4352fa2f 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -467,7 +467,10 @@ sub _page_user { } } - $dbh->do('DELETE FROM votes WHERE vote_count <= 0'); + if ($canedit && $bug) { + $dbh->do('DELETE FROM votes WHERE vote_count = 0 AND who = ?', + undef, $who->id); + } $dbh->bz_commit_transaction(); $vars->{'canedit'} = $canedit; -- cgit v1.2.3-24-g4f1b