Is there a way to detect locked tables in MySQL? I mean tables locked by the LOCK TABLE table WRITE/READ
command.
(Note that readers interested in
This article describes how to get information about locked MySQL resources. mysqladmin debug
might also be of some use.
You could also get all relevant details from performance_schema:
SELECT
OBJECT_SCHEMA
,OBJECT_NAME
,GROUP_CONCAT(DISTINCT EXTERNAL_LOCK)
FROM performance_schema.table_handles
WHERE EXTERNAL_LOCK IS NOT NULL
GROUP BY
OBJECT_SCHEMA
,OBJECT_NAME
This works similar as
show open tables WHERE In_use > 0