Name

IS_USED_LOCK( )

Synopsis

IS_USED_LOCK(string)

Use this function to determine if the name given is already in use as a lock name. If the lock name is in use, it returns the connection identifier of the client holding the lock. It returns NULL if it is not in use. Locks are created by GET_LOCK( ).

SELECT IS_USED_LOCK('my_lock');
+-------------------------+
| IS_USED_LOCK('my_lock') |
+-------------------------+
|                       1 |
+-------------------------+

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.