diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 11103c137..abec75f72 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -1000,7 +1000,9 @@ class ToolsLog extends LogAPI /** * @see \CMDBSource::LogDeadLock() - * @since 2.7.1 + * @since 2.7.1 PR #139 + * + * @link https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks.html */ class DeadLockLog extends LogAPI { @@ -1025,10 +1027,10 @@ class DeadLockLog extends LogAPI { switch ($iMysqlErrorNo) { - case 1205: + case CMDBSource::MYSQL_ERRNO_WAIT_TIMEOUT: return self::CHANNEL_WAIT_TIMEOUT; break; - case 1213: + case CMDBSource::MYSQL_ERRNO_DEADLOCK: return self::CHANNEL_DEADLOCK_FOUND; break; default: diff --git a/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php index 465b204d4..e85c5064d 100644 --- a/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php +++ b/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php @@ -56,7 +56,7 @@ class DeadLockInjection if ($this->iRequestCount == $this->iFailAt) { echo "Generating a FAKE DEADLOCK\n"; IssueLog::Trace("Generating a FAKE DEADLOCK", 'cmdbsource'); - throw new MySQLException("FAKE DEADLOCK", [], new Exception("FAKE DEADLOCK", 1213)); + throw new MySQLException("FAKE DEADLOCK", [], new Exception("FAKE DEADLOCK", CMDBSource::MYSQL_ERRNO_DEADLOCK)); } } }