From e9bffe40204af9aaee40d0d46f13900cb1573144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Jaramillo=20Mart=C3=ADnez?= Date: Mon, 22 Oct 2018 22:33:16 -0500 Subject: [PATCH] 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. --- src/ORM/Connect/MySQLDatabase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ORM/Connect/MySQLDatabase.php b/src/ORM/Connect/MySQLDatabase.php index 7a518ee70..74f155e30 100644 --- a/src/ORM/Connect/MySQLDatabase.php +++ b/src/ORM/Connect/MySQLDatabase.php @@ -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(); }