Closed Bug 686133 Opened 13 years ago Closed 13 years ago

Bugzilla crashes when deleting a bug

Categories

(Bugzilla :: Administration, task)

4.1.3
task
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression, selenium)

Attachments

(2 files, 1 obsolete file)

Attached patch patch, v1 (obsolete) — Splinter Review
When deleting a bug, you get:

Can't locate object method "DESTROY" via package "Bugzilla::Bug" at Bugzilla/Bug.pm line 1134.

This is working fine in 4.0 and older. I suspect this is due to the removal of Bugzilla::Bug::AUTOLOAD in bug 600123.

Thanks to our QA scripts for finding this bug. \o/
Attachment #559702 - Flags: review?(timello)
Flags: testcase+
Flags: blocking4.2+
Blocks: 683680
Comment on attachment 559702 [details] [diff] [review]
patch, v1

I think you should 'undef $self' before returning it, shouldn't you?
Attachment #559702 - Flags: review?(timello) → review-
For 5.0, rely on foreign keys to delete all references to the bug being deleted. For 4.2, I will attach a much less invasive patch, based on timello's suggestion.
Attachment #559702 - Attachment is obsolete: true
Attachment #559718 - Flags: review?(timello)
Attachment #559719 - Flags: review?(timello)
Comment on attachment 559719 [details] [diff] [review]
patch for 4.2, v2

Review of attachment 559719 [details] [diff] [review]:
-----------------------------------------------------------------

It looks good!
Attachment #559719 - Flags: review?(timello) → review+
Comment on attachment 559718 [details] [diff] [review]
patch for 5.0, v2

Review of attachment 559718 [details] [diff] [review]:
-----------------------------------------------------------------

::: Bugzilla/Bug.pm
@@ +1091,3 @@
>  
>      my $bug_id = $self->{'bug_id'};
> +    $self->SUPER::remove_from_db();

I think we should start a transaction before calling SUPER::remove_from_db and close it after we delete bug_fulltext.
Attachment #559718 - Flags: review?(timello) → review-
Comment on attachment 559718 [details] [diff] [review]
patch for 5.0, v2

No, SUPER::remove_from_db() already starts the transaction for us, and MySQL tables do not support transactions.
Attachment #559718 - Flags: review- → review?(timello)
(In reply to Frédéric Buclin from comment #6)
> MySQL tables do not support transactions.

I meant MyISAM tables.
Comment on attachment 559718 [details] [diff] [review]
patch for 5.0, v2

Review of attachment 559718 [details] [diff] [review]:
-----------------------------------------------------------------

Nice cleanup!
Attachment #559718 - Flags: review?(timello) → review+
Flags: approval?
Flags: approval?
Flags: approval4.2+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
Committed revision 7956.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/Bug.pm
Committed revision 7924.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Keywords: selenium
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: