From 9333d59e6cbc598c8d74050fa5ca48e6788f507e Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Fri, 17 Nov 2006 16:41:05 +0000 Subject: [PATCH] TestCaseRun obliterate doesn't delete the history. git-svn-id: svn://10.0.0.236/trunk@215406 18797224-902f-48f8-a5cc-f745e15eee43 --- .../webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm index e55d079331c..6fe5d6a1a99 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm @@ -991,7 +991,7 @@ sub candelete { =head2 obliterate -Removes this caserun and all things that reference it. +Removes this caserun, it's history, and all things that reference it. =cut @@ -1000,8 +1000,10 @@ sub obliterate { return 0 unless $self->candelete; my $dbh = Bugzilla->dbh; - $dbh->do("DELETE FROM test_case_bugs WHERE case_run_id = ?", undef, $self->id); - $dbh->do("DELETE FROM test_case_runs WHERE case_run_id = ?", undef, $self->id); + $dbh->do("DELETE FROM test_case_bugs WHERE case_run_id IN (" . + join(",", @{$self->get_case_run_list}) . ")", undef, $self->id); + $dbh->do("DELETE FROM test_case_runs WHERE case_id = ? AND run_id = ?", + undef, ($self->case_id, $self->run_id)); return 1; }