Retrofit from trunk

N°1163 - GET_LOCK 64 characters limitation in MySQL [from revision 5135]

SVN:2.4[5136]
This commit is contained in:
Eric Espié
2017-11-21 12:32:13 +00:00
parent cc99cec250
commit 7b4f00ee45

View File

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