From: Aaron Schulz Date: Wed, 23 Nov 2011 23:45:46 +0000 (+0000) Subject: Added wasLockTimeout() DB function. All our DBMS can implement this accept for PG. X-Git-Tag: 1.31.0-rc.0~26313 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=608963577b763271087bc19852706e6bf7678340;p=lhc%2Fweb%2Fwiklou.git Added wasLockTimeout() DB function. All our DBMS can implement this accept for PG. --- 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