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.