Bug #28614 ha_create_table() requires LOCK_open mutex to be held for some engines
Submitted: 23 May 2007 12:44 Modified: 23 May 2007 12:45
Reporter: Dmitri Lenev
Status: Verified
Category:Server: Locking Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: Target Version:
Triage: Triaged: D5 (Feature request)

[23 May 2007 12:44] Dmitri Lenev
Description:
For some engines (e.g. NDB cluster) ha_create_table() requires LOCK_open to be owned
before calling it. AFAIU this requirement is imposed by the fact that ha_create_table()
for such tables ultimately calls assign_new_table_id() (see bug #19513 for stack trace
proving that). There are several reasons why this requirement is not a good thing and
should be removed long-term:
 - requirement to have LOCK_open for calling ha_create_table() 
   decreases concurrency. It should be enough to have an exclusive
   name-lock on table being created.
 - LOCK_open is actually detail of table-cache's implementation and its
   use should be avoided outside of its functions as much as possible.
 - It complicates things for federated handler. See bug #25679
   "Denial-of-Service against entire server if FEDERATED engine
    is compiled"

See also bug #18950 and bug #23667.

How to repeat:
Inspect code implementing CREATE TABLE and CREATE TABLE LIKE.