mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8511 from jmfederico/patch-1
Update comment about locks in MySQL
This commit is contained in:
commit
536e2d6835
@ -495,8 +495,9 @@ class MySQLDatabase extends Database
|
|||||||
{
|
{
|
||||||
$id = $this->getLockIdentifier($name);
|
$id = $this->getLockIdentifier($name);
|
||||||
|
|
||||||
// MySQL auto-releases existing locks on subsequent GET_LOCK() calls,
|
// MySQL 5.7.4 and below auto-releases existing locks on subsequent GET_LOCK() calls.
|
||||||
// in contrast to PostgreSQL and SQL Server who stack the locks.
|
// MySQL 5.7.5 and newer allow multiple locks per sessions even with the same name.
|
||||||
|
// https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock
|
||||||
return (bool) $this->query(sprintf("SELECT GET_LOCK('%s', %d)", $id, $timeout))->value();
|
return (bool) $this->query(sprintf("SELECT GET_LOCK('%s', %d)", $id, $timeout))->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user