Merge "rdbms: add IDatabase::wasConnectionLoss() method"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 20 Mar 2018 02:41:28 +0000 (02:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 20 Mar 2018 02:41:28 +0000 (02:41 +0000)
includes/libs/rdbms/database/DatabasePostgres.php

index 7b2ef83..49c945e 100644 (file)
@@ -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(