From b401c656840f7b174da1739ef4a2a147b90af645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Espi=C3=A9?= Date: Tue, 21 Nov 2017 12:14:20 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B01163=20-=20GET=5FLOCK=2064=20characters?= =?UTF-8?q?=20limitation=20in=20MySQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SVN:trunk[5135] --- core/mutex.class.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/mutex.class.inc.php b/core/mutex.class.inc.php index 1c11b6bc8..1f0457f12 100644 --- a/core/mutex.class.inc.php +++ b/core/mutex.class.inc.php @@ -45,7 +45,7 @@ class iTopMutex } $sDBName = $oConfig->GetDBName(); $sDBSubname = $oConfig->GetDBSubname(); - $this->sName = 'itop.'.$sName; + $this->sName = $sName; if (substr($sName, -strlen($sDBName.$sDBSubname)) != $sDBName.$sDBSubname) { // If the name supplied already ends with the expected suffix @@ -54,6 +54,9 @@ class iTopMutex $this->sName .= $sDBName.$sDBSubname; } + // Limit the length of the name for MySQL > 5.7.5 + $this->sName = 'itop.'.md5($this->sName); + $this->bLocked = false; // Not yet locked if (!array_key_exists($this->sName, self::$aAcquiredLocks))