RELEASE_LOCK()

Overview

Returns a boolean to indicate if a named user-level lock was released.

USAGE

RELEASE_LOCK(name)

Argument Name

Description

name

The string expression for the user-level lock name

DETAILS

RELEASE_LOCK() is a locking function that returns a boolean (1 or 0) to indicate if a named user-level lock was released.

The lock names are determined by the user, and can be used in any desired programming logic.

In addition to being explicitly released, a lock is also implicitly released when the session that locked it is closed. See GET_LOCK() for how to acquire a lock.

A NULL is returned if the named user lock does not exist (a lock only exists when locked).

If the lock is not held by the current user, nothing is done and a 0 is returned.

An error is returned if the lock name is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT GET_LOCK('my-lock', 10);
+-------------------------+
| GET_LOCK('my-lock', 10) |
+-------------------------+
|                       1 |
+-------------------------+
SELECT RELEASE_LOCK('my-lock');
+-------------------------+
| RELEASE_LOCK('my-lock') |
+-------------------------+
|                       1 |
+-------------------------+
SELECT RELEASE_LOCK('my-lock');
+-------------------------+
| RELEASE_LOCK('my-lock') |
+-------------------------+
|                    NULL |
+-------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES