Show all current locks from get_lock

前端 未结 7 1466
渐次进展
渐次进展 2020-12-13 12:00

Is there any way to select / show all current locks that have been taken out using the GET_LOCK function?

Note that GET_LOCK locks are different from ta

7条回答
  •  春和景丽
    2020-12-13 12:51

    If you just want to determine whether a particular named lock is currently held, you can use IS_USED_LOCK:

    SELECT IS_USED_LOCK('foobar');
    

    If some connection holds the lock, that connection's ID will be returned; otherwise, the result is NULL.

提交回复
热议问题