Bug #74542 FLUSH TABLES WITH READ LOCK blocks EXPLAIN UPDATE/DELETE/INSERT
Submitted: 24 Oct 2014 10:05 Modified: 24 Oct 2014 10:50
Reporter: Alexey Kopytov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:5.6/5.7 OS:Any
Assigned to: CPU Architecture:Any

[24 Oct 2014 10:05] Alexey Kopytov
Description:
The global read lock acquired by FTWRL blocks EXPLAIN UPDATE/DELETE/INSERT even though technically there is no reason to do so.

mysql1> create table t (a int);
Query OK, 0 rows affected (0.02 sec)

mysql1> insert into t values(1);
Query OK, 1 row affected (0.01 sec)

mysql2> flush tables with read lock;
Query OK, 0 rows affected (0.00 sec)

mysql1> set lock_wait_timeout=1;
Query OK, 0 rows affected (0.00 sec)

mysql1> explain insert into t values(2);
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
mysql1> explain delete from t;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
mysql1> explain update t set a=2;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

How to repeat:
See above.
[24 Oct 2014 10:50] MySQL Verification Team
Thank you for the bug report.