GET_LOCK(str,timeout) : GET_LOCK : Miscellaneous Functions MySQL TUTORIALS


MySQL TUTORIALS » Miscellaneous Functions » GET_LOCK »

 

GET_LOCK(str,timeout)


mysql>
mysql> SELECT GET_LOCK('lock1',10);
+----------------------+
| GET_LOCK('lock1',10|
+----------------------+
|                    |
+----------------------+
row in set (0.00 sec)

mysql> SELECT IS_FREE_LOCK('lock2');
+-----------------------+
| IS_FREE_LOCK('lock2') |
+-----------------------+
|                     |
+-----------------------+
row in set (0.00 sec)

mysql> SELECT GET_LOCK('lock2',10);
+----------------------+
| GET_LOCK('lock2',10|
+----------------------+
|                    |
+----------------------+
row in set (0.01 sec)

mysql> SELECT RELEASE_LOCK('lock2');
+-----------------------+
| RELEASE_LOCK('lock2') |
+-----------------------+
|                     |
+-----------------------+
row in set (0.00 sec)

mysql> SELECT RELEASE_LOCK('lock1');
+-----------------------+
| RELEASE_LOCK('lock1') |
+-----------------------+
|                  NULL |
+-----------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Miscellaneous Functions
» GET_LOCK