Skip to content

Instantly share code, notes, and snippets.

@tperalta82
Created July 3, 2024 18:37
Show Gist options
  • Save tperalta82/6ba9200f17ba7423d564894ae8018feb to your computer and use it in GitHub Desktop.
Save tperalta82/6ba9200f17ba7423d564894ae8018feb to your computer and use it in GitHub Desktop.
Check for locked transactions
SELECT OBJECT_TYPE,
OBJECT_SCHEMA,
OBJECT_NAME,
LOCK_TYPE,
LOCK_STATUS,
THREAD_ID,
PROCESSLIST_ID,
PROCESSLIST_INFO
FROM performance_schema.metadata_locks
INNER JOIN performance_schema.threads ON THREAD_ID = OWNER_THREAD_ID
WHERE PROCESSLIST_ID <> CONNECTION_ID();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment