Bug #21784 DROP TABLE crashes 5.1.12-pre if concurrent queries on the table
Submitted: 22 Aug 2006 13:47 Modified: 18 Jun 2010 12:48
Reporter: Heikki Tuuri Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.1.12-pre OS:Any (All)
Assigned to: Heikki Tuuri CPU Architecture:Any

[22 Aug 2006 13:47] Heikki Tuuri
Description:
The patch that fixes http://bugs.mysql.com/bug.php?id=20213 introduced a new bug because in DROP TABLE, MySQL lets the DROP TABLE thd call ::store_lock() on a table handle of ANOTHER thd, which makes InnoDB to bind the table handle to the wrong transaction object in update_thd() that is called inside ::store_lock().

How to repeat:
See the synopsis.

Suggested fix:
Do not call update_thd() in ::store_lock(). Instead, use the trx object in thd directly. This still leaves a slight bug that select_lock_type in the table handle may be inited wrong when the thd doing the DROP TABLE calls ::store_lock() on the table handle!
[31 Aug 2006 20:51] Heikki Tuuri
I now have a patch that removes update_thd() in ::store_lock().
[13 Sep 2006 8:52] Timothy Smith
Pushed to 5.1.12
[14 Sep 2006 8:16] MC Brown
A note has been added to the 5.1.12 changelog.
[5 May 2010 15:02] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 2:26] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 6:13] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:41] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 7:09] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 2:49] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 12:19] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:07] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:47] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)