Bug #47107 | assert in notify_shared_lock on incorrect CREATE TABLE , HANDLER | ||
---|---|---|---|
Submitted: | 3 Sep 2009 17:58 | Modified: | 7 Mar 2010 1:55 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S3 (Non-critical) |
Version: | 5.4 | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | handler, mdl |
[3 Sep 2009 17:58]
Matthias Leich
[10 Sep 2009 9:33]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/82906 2814 Jon Olav Hauglid 2009-09-10 Bug #47107 assert in notify_shared_lock on incorrect CREATE TABLE , HANDLER The problem here was that the HANDLER was not closed by CREATE TABLE before CREATE tried to open and lock the table. Acquire exclusive MDL lock on the table to be created would therefore fail since HANDLER already had a shared MDL lock. This triggered an assert since the HANDLER and CREATE statements came from the same thread (self-deadlock). This patch resolves the issue by closing any open HANDLERs on tables to be created by CREATE TABLE, similar to what is already done for DROP and ALTER TABLE. Test case added to create.test.
[11 Sep 2009 15:12]
Dmitry Lenev
Approved with minor comments sent by e-mail.
[14 Sep 2009 7:43]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/83136 2815 Jon Olav Hauglid 2009-09-14 Bug #47107 assert in notify_shared_lock on incorrect CREATE TABLE , HANDLER Attempts to create a table (using CREATE TABLE, CREATE TABLE LIKE or CREATE TABLE SELECT statements) which already existed and was opened by the same connection through HANDLER statement, led to a stalled connection (for production builds of the server) or to the server being aborted due to an assertion failure (for debug builds of the server). This problem was introduced by the new implementation of a metadata locking subsystem and didn't affect earlier versions of the server. The cause of the problem was that the HANDLER was not closed by CREATE TABLE before CREATE tried to open and lock the table. Acquiring an exclusive MDL lock on the table to be created would therefore fail since HANDLER already had a shared MDL lock. This triggered an assert as the HANDLER and CREATE statements came from the same thread (self-deadlock). This patch resolves the issue by closing any open HANDLERs on tables to be created by CREATE TABLE, similar to what is already done for DROP and ALTER TABLE. Test case added to create.test.
[14 Sep 2009 7:44]
Jon Olav Hauglid
Pushed to mysql-next-bugfixing (5.4.4-alpha)
[14 Sep 2009 10:38]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/83155 2816 Tor Didriksen 2009-09-14 Bug#47107 Add missing line in previous change set. @ mysql-test/r/create.result Bug#47107 Add missing line in previous change set.
[15 Sep 2009 13:52]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090915134838-5nj3ycjfsqc2vr2f) (version source revid:alik@sun.com-20090914161222-1gvwajrhv7zv39mz) (merge vers: 5.4.4-alpha) (pib:11)
[23 Sep 2009 20:17]
Paul DuBois
Noted in 5.4.4 changelog. A CREATE TABLE attempt for a table that had been opened with HANDLER caused an assertion failure because CREATE TABLE did not close any open handlers for the table.
[9 Dec 2009 12:28]
Jon Olav Hauglid
Pushed to mysql-next-4284 (5.6.0-beta).
[16 Feb 2010 16:49]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100216101445-2ofzkh48aq2e0e8o) (version source revid:kostja@sun.com-20091211154405-c9yhiewr9o5d20rq) (merge vers: 6.0.14-alpha) (pib:16)
[16 Feb 2010 16:59]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100216101208-33qkfwdr0tep3pf2) (version source revid:kostja@sun.com-20091210084103-l4f8u62u4evoy3dc) (pib:16)
[16 Feb 2010 19:27]
Dmitry Lenev
Since this bug is not repeatable in any publicly available tree with version < 6.0 there is nothing to document. So I am simply closing this bug.
[6 Mar 2010 11:05]
Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@mysql.com-20100216221947-luyhph0txl2c5tc8) (merge vers: 5.5.99-m3) (pib:16)
[7 Mar 2010 1:55]
Paul DuBois
No changelog entry needed.