IS_USED_LOCK()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the connection identifier of the client session that holds a named user-level lock.
USAGE
IS_USED_LOCK(name)
Argument Name | Description |
---|---|
| The string argument that is to be checked |
DETAILS
IS_USED_LOCK()
is a locking function that returns the connection identifier of a named user-level lock if it is locked.
The return value is NULL
if the name
argument is not a locked user-level lock, otherwise it is a connection identifier.
An error is returned if the name
argument is NULL
.
EXAMPLES
SELECT IS_USED_LOCK('mylock');
+------------------------+
| IS_USED_LOCK('mylock') |
+------------------------+
| NULL |
+------------------------+
SELECT IS_USED_LOCK(NULL);
ERROR 1 (HY000): [24576] Unknown prepared param type: "t_null"
SELECT IS_USED_LOCK(1);
+-----------------+
| IS_USED_LOCK(1) |
+-----------------+
| NULL |
+-----------------+