Update comment about locks in MySQL

MySQL 5.7.5 and newer allow for multiple lock form the same session. This information is now reflected in the comment.
This commit is contained in:
Federico Jaramillo Martínez 2018-10-22 22:33:16 -05:00 committed by GitHub
parent 9ceef59e1b
commit e9bffe4020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -495,8 +495,9 @@ class MySQLDatabase extends Database
{
$id = $this->getLockIdentifier($name);
// MySQL auto-releases existing locks on subsequent GET_LOCK() calls,
// in contrast to PostgreSQL and SQL Server who stack the locks.
// MySQL 5.7.4 and below auto-releases existing locks on subsequent GET_LOCK() calls.
// 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();
}