Advertisement
fooflington

MySQL GET_LOCK() debugging

Jan 24th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.45 KB | None | 0 0
  1. -- Return details of what Userspace locks (via GET_LOCK()) are being waited for
  2. -- and what the owning thread is doing, if anything
  3.  
  4. SELECT
  5.     p1.time as waitingfor,
  6.     SUBSTRING_INDEX(SUBSTRING(p1.info, 18), "'", 1) as lock_key,
  7.     IS_USED_LOCK(SUBSTRING_INDEX(SUBSTRING(p1.info, 18), "'", 1)) as pid,
  8.     p2.*
  9. FROM information_schema.processlist p1, information_schema.processlist p2
  10. WHERE
  11.     p1.info like "SELECT GET_LOCK('%"
  12. HAVING pid = p2.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement