Bugzilla crashes when deleting a bug

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Administration
--
major
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({regression, selenium})

4.1.3
Bugzilla 4.2
regression, selenium
Bug Flags:
approval +
approval4.2 +
blocking4.2 +
testcase +

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 559702 [details] [diff] [review]
patch, v1

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+
(Assignee)

Updated

6 years ago
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-
(Assignee)

Comment 2

6 years ago
Created attachment 559718 [details] [diff] [review]
patch for 5.0, v2

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)
(Assignee)

Comment 3

6 years ago
Created attachment 559719 [details] [diff] [review]
patch for 4.2, v2
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-
(Assignee)

Comment 6

6 years ago
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)
(Assignee)

Comment 7

6 years ago
(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+

Updated

6 years ago
Flags: approval?
(Assignee)

Updated

6 years ago
Flags: approval?
Flags: approval4.2+
Flags: approval+
(Assignee)

Comment 9

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
Keywords: selenium
You need to log in before you can comment on or make changes to this bug.