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))