Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	core/log.class.inc.php
  • Loading branch information
Pierre Goiffon committed Apr 12, 2023
2 parents 1ddfaf0 + 1114ed9 commit 4c626d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/log.class.inc.php
Expand Up @@ -961,7 +961,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
{
Expand All @@ -986,10 +988,10 @@ private static function GetChannelFromMysqlErrorNo($iMysqlErrorNo)
{
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:
Expand Down
Expand Up @@ -56,7 +56,7 @@ public function query($sSQL)
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));
}
}
}
Expand Down

0 comments on commit 4c626d0

Please sign in to comment.