Bug #50912 | Assertion `ticket->m_type >= mdl_request->type' failed on HANDLER + I_S | ||
---|---|---|---|
Submitted: | 4 Feb 2010 12:33 | Modified: | 7 Mar 2010 1:02 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S2 (Serious) |
Version: | mysql-next-4284 | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
[4 Feb 2010 12:33]
Philip Stoev
[5 Feb 2010 14:17]
Jon Olav Hauglid
HANDLER OPEN acquires a metadata lock of type MDL_SHARED. The I_S query requests a MDL_SHARED_HIGH_PRIO lock. The existing MDL_SHARED ticket is found in find_ticket() since it satisfies ticket->has_stronger_or_equal_type(mdl_request->type). However since MDL_SHARED_HIGH_PRIO < MDL_SHARED, this assert is triggered right after. A similar assert would have been triggered in clone_ticket() right afterwards.
[5 Feb 2010 16:00]
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/99478 3077 Jon Olav Hauglid 2010-02-05 Bug #50912 Assertion `ticket->m_type >= mdl_request->type' failed on HANDLER + I_S This assert was triggered when an I_S query tried to lock a table already locked by a HANDLER statement in the same connection. First the HANDLER took a MDL_SHARED lock. Afterwards, the I_S query requested a MDL_SHARED_HIGH_PRIO lock. The existing MDL_SHARED ticket is found in find_ticket() since it satisfies ticket->has_stronger_or_equal_type(mdl_request->type) as MDL_SHARED and MDL_SHARED_HIGH_PRIO have equal strengths, just different priority. However, two asserts later check lock type strengths using relational operators (>= and <=) rather than MDL_ticket::has_stronger_or_equal_type(). These asserts are triggered since MDL_SHARED >= MDL_SHARED_HIGH_PRIORITY is false (mapped to 1 and 2 respectively). This patch updates the asserts to use MDL_ticket::has_stronger_or_equal_type() rather than relational operators to check lock type strength. Test case added to include/handler.inc.
[5 Feb 2010 20:20]
Dmitry Lenev
Approved with minor comments sent by e-mail.
[6 Feb 2010 9:44]
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/99538 3084 Jon Olav Hauglid 2010-02-06 Bug #50912 Assertion `ticket->m_type >= mdl_request->type' failed on HANDLER + I_S This assert was triggered when an I_S query tried to acquire a metadata lock on a table which was already locked by a HANDLER statement in the same connection. First the HANDLER took a MDL_SHARED lock. Afterwards, the I_S query requested a MDL_SHARED_HIGH_PRIO lock. The existing MDL_SHARED ticket is found in find_ticket() since it satisfies ticket->has_stronger_or_equal_type(mdl_request->type) as MDL_SHARED and MDL_SHARED_HIGH_PRIO have equal strengths, just different priority. However, two asserts later check lock type strengths using relational operators (>= and <=) rather than MDL_ticket::has_stronger_or_equal_type(). These asserts are triggered since MDL_SHARED >= MDL_SHARED_HIGH_PRIORITY is false (mapped to 1 and 2 respectively). This patch updates the asserts to use MDL_ticket::has_stronger_or_equal_type() rather than relational operators to check lock type strength. Test case added to include/handler.inc.
[6 Feb 2010 9:46]
Jon Olav Hauglid
Pushed to mysql-next-4284. Closing the bug as the patch adjusts two asserts that only exist in next-4284. Since this is an internal tree, no documentation changes are necessary.
[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-20100210211106-nq8ztcq2z9o4csit) (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-20100206103007-2te50xtpwd7o3spx) (pib:16)
[6 Mar 2010 11:03]
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:02]
Paul DuBois
No changelog entry needed.