Collections:
IS_FREE_LOCK() - Checking Lock Status
How to check the status of a user defined lock using the IS_FREE_LOCK() function?
✍: FYIcenter.com
IS_FREE_LOCK(lock) is a MySQL built-in function that
returns 1 if a given user lock is free, 0 otherwise.
For example:
SELECT GET_LOCK('MyLock', 60), IS_FREE_LOCK('MyLock');
-- +------------------------+------------------------+
-- | GET_LOCK('MyLock', 60) | IS_FREE_LOCK('MyLock') |
-- +------------------------+------------------------+
-- | 1 | 0 |
-- +------------------------+------------------------+
SELECT RELEASE_LOCK('MyLock'), IS_FREE_LOCK('MyLock');
-- +------------------------+------------------------+
-- | RELEASE_LOCK('MyLock') | IS_FREE_LOCK('MyLock') |
-- +------------------------+------------------------+
-- | 1 | 1 |
-- +------------------------+------------------------+
Reference information of the IS_FREE_LOCK() function:
IS_FREE_LOCK(lock): boolean Returns 1 if a given user lock is free, 0 otherwise. Arguments, return value and availability: lock: Required. The lock name to be examined. boolean: Return value. 1 if the lock is free, 0 otherwise. Available since MySQL 4.
⇒ IS_IPV4() - Detecting IPv4 Address
⇐ INET6_NTOA() - IPv6 Address Number to String
2023-12-20, 883🔥, 0💬
Popular Posts:
Is SQL Server Transact-SQL case sensitive? No. Transact-SQL is not case sensitive. Like the standard...
What are single-byte character string data types supported in SQL Server Transact-SQL? Single-byte c...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...