Added wasLockTimeout() DB function. All our DBMS can implement this accept for PG.
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 23 Nov 2011 23:45:46 +0000 (23:45 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 23 Nov 2011 23:45:46 +0000 (23:45 +0000)
includes/db/Database.php
includes/db/DatabaseMysql.php

index 38d1dbe..70c7973 100644 (file)
@@ -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.
index 793815b..dd8afd6 100644 (file)
@@ -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