MySQL Tutorial/Miscellaneous Functions/GET LOCK — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 09:49, 26 мая 2010
GET_LOCK(str,timeout)
mysql>
mysql> SELECT GET_LOCK("lock1",10);
+----------------------+
| GET_LOCK("lock1",10) |
+----------------------+
| 1 |
+----------------------+
1 row in set (0.00 sec)
mysql> SELECT IS_FREE_LOCK("lock2");
+-----------------------+
| IS_FREE_LOCK("lock2") |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
mysql> SELECT GET_LOCK("lock2",10);
+----------------------+
| GET_LOCK("lock2",10) |
+----------------------+
| 1 |
+----------------------+
1 row in set (0.01 sec)
mysql> SELECT RELEASE_LOCK("lock2");
+-----------------------+
| RELEASE_LOCK("lock2") |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
mysql> SELECT RELEASE_LOCK("lock1");
+-----------------------+
| RELEASE_LOCK("lock1") |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
mysql>