From: Aaron Schulz Date: Tue, 20 Mar 2018 01:08:37 +0000 (-0700) Subject: rdbms: define wasLockTimeout() for postgres X-Git-Tag: 1.31.0-rc.0~344 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=c6ac3d182cf2d6a0090c3dc3db87be4a89e1e708 rdbms: define wasLockTimeout() for postgres Change-Id: Ic54530f0b48fb3e3a42c1e6e95a5a75c6b5c061d --- diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 7b2ef831e5..49c945e91f 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -799,7 +799,13 @@ __INDEXATTR__; } public function wasDeadlock() { - return $this->lastErrno() == '40P01'; + // https://www.postgresql.org/docs/8.2/static/errcodes-appendix.html + return $this->lastErrno() === '40P01'; + } + + public function wasLockTimeout() { + // https://www.postgresql.org/docs/8.2/static/errcodes-appendix.html + return $this->lastErrno() === '55P03'; } public function duplicateTableStructure(