Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.1.17
-
None
-
10.1.18
Description
A 'create temporary table as select' statement seems to produce an unnecessary table lock (which applies across all connections) against the table identifier. This can cause deadlocks in a simple case and in the more complex case (where the select is marked 'for update') can produce a ER_LOCK_WAIT_TIMEOUT error. Attached is a sql script to set up the database for reproduction. Call the procedure `sp_test` from two connections to see the error.
Breaking the statement into separate 'create' and 'insert' statements produces the expected locking behaviour whereby neither thread is held up.
Tested against mariadb 10.1.17 on ubuntu 16.04.1 LTS.
Attachments
Issue Links
- relates to
-
MDEV-5879 MySQL WL#5576 Prohibit CREATE TABLE ... SELECT to modify other tables
-
- Open
-
-
MDEV-7660 MySQL WL#6671 "Improve scalability by not using thr_lock.c locks for InnoDB tables"
-
- Closed
-
-
MDEV-24813 Locking full table scan fails to use table-level locking
-
- In Review
-