Collections:
IS_USED_LOCK() - Checking Lock Owner
How to check the owner of a user defined lock using the IS_USED_LOCK() function?
✍: FYIcenter.com
IS_USED_LOCK(lock) is a MySQL built-in function that
returns the connection id the lock associated with if the lock is in use,
NULL otherwise.
For example:
SELECT GET_LOCK('MyLock', 60), IS_USED_LOCK('MyLock'); -- +------------------------+------------------------+ -- | GET_LOCK('MyLock', 60) | IS_USED_LOCK('MyLock') | -- +------------------------+------------------------+ -- | 1 | 307 | -- +------------------------+------------------------+ SELECT RELEASE_LOCK('MyLock'), IS_USED_LOCK('MyLock'); -- +------------------------+------------------------+ -- | RELEASE_LOCK('MyLock') | IS_USED_LOCK('MyLock') | -- +------------------------+------------------------+ -- | 1 | NULL | -- +------------------------+------------------------+
Reference information of the IS_USED_LOCK() function:
IS_USED_LOCK(lock): boolean Returns the connection id the lock associated with if the lock is in use, NULL otherwise. Arguments, return value and availability: lock: Required. The lock name to be examined. boolean: Return value. Connection id the lock associated with if the lock is in use, NULL otherwise. Available since MySQL 4.
⇒ ISNULL() - Detecting NULL Value
⇐ IS_IPV6() - Detecting IPv6 Address
2023-12-20, 854🔥, 0💬
Popular Posts:
How To Set Up SQL*Plus Output Format in Oracle? If you want to practice SQL statements with SQL*Plus...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...