At 10:12, 19990728, Scott Hess wrote:
>Just now, I noticed that if you try to aquire a lock that you already have,
>mysql first releases the lock before aquiring it.
>
>Just wanted to double-check that this is how things are _intended_ to work,
>rather than just a happy coincidence. The documentation does not say.
The docs do say.
|`GET_LOCK(str,timeout)'
| ...
| A lock is released when you execute `RELEASE_LOCK()',
| execute a new `GET_LOCK()' or the thread terminates.
| ...
|
| mysql> select GET_LOCK("lock1",10);
| -> 1
| mysql> select GET_LOCK("lock2",10);
| -> 1
| mysql> select RELEASE_LOCK("lock2");
| -> 1
| mysql> select RELEASE_LOCK("lock1");
| -> NULL
|
| Note that the second `RELEASE_LOCK()' call returns `NULL' because
| the lock `"lock1"' was automatically released by the second
| `GET_LOCK()' call.
Tim