Purpose
RELEASE_LOCK() releases the lock with the name given by str, which was obtained by the current session with GET_LOCK().
Syntax
RELEASE_LOCK('str')
Description
Parameters
str: the name of the lock to be released. The value is a string.
Return value
1: indicates that the lock was released.0: indicates that the lock failed to be released because it is not held by the current session.NULL: indicates that the lock does not exist, that is, it was never obtained withGET_LOCK()or it has previously been released.
Examples
Release the lock named my_lock.
obclient [(none)]> SELECT RELEASE_LOCK('my_lock');
The return result is as follows:
+-------------------------+
| RELEASE_LOCK('my_lock') |
+-------------------------+
| 0 |
+-------------------------+
1 row in set
0 is returned, indicating that the lock my_lock failed to be released because it is not held by the current session.