From 608963577b763271087bc19852706e6bf7678340 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 23 Nov 2011 23:45:46 +0000 Subject: [PATCH] Added wasLockTimeout() DB function. All our DBMS can implement this accept for PG. --- includes/db/Database.php | 10 ++++++++++ includes/db/DatabaseMysql.php | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/includes/db/Database.php b/includes/db/Database.php index 38d1dbec35..70c7973865 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2649,6 +2649,16 @@ abstract class DatabaseBase implements DatabaseType { return false; } + /** + * Determines if the last failure was due to a lock timeout + * STUB + * + * @return bool + */ + function wasLockTimeout() { + return false; + } + /** * Determines if the last query error was something that should be dealt * with by pinging the connection and reissuing the query. diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 793815bf03..dd8afd683f 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -706,6 +706,15 @@ class DatabaseMysql extends DatabaseBase { return $this->lastErrno() == 1213; } + /** + * Determines if the last failure was due to a lock timeout + * + * @return bool + */ + function wasLockTimeout() { + return $this->lastErrno() == 1205; + } + /** * Determines if the last query error was something that should be dealt * with by pinging the connection and reissuing the query -- 2.20.1