From 19630bdbdff44d9286ca489c39d3eaf52f391f5c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 11 Jun 2005 02:19:21 +0000 Subject: Bug 277417: SQL error when reloading the page after changing the bug resolution to duplicate - Patch by Frédéric Buclin r=wicked a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process_bug.cgi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index 7b0dd6a8a..34444dfcf 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1038,6 +1038,16 @@ SWITCH: for ($cgi->param('knob')) { ThrowUserError("dupe_of_self_disallowed"); } + # Make sure the bug is not already marked as a dupe + # (may appear in race condition) + my $dupe_of = + $dbh->selectrow_array("SELECT dupe_of FROM duplicates + WHERE dupe = ?", + undef, $cgi->param('id')); + if ($dupe_of) { + ThrowUserError("dupe_entry_found", { dupe_of => $dupe_of }); + } + # DUPLICATE bugs should have no time remaining. _remove_remaining_time(); -- cgit v1.2.3-24-g4f1b