add IGNORE INDEX option to mysql database handler
[lhc/web/wiklou.git] / includes / db / DatabaseMysqlBase.php
index 13be911..52dee01 100644 (file)
@@ -782,8 +782,10 @@ abstract class DatabaseMysqlBase extends Database {
                        throw new InvalidArgumentException( "Position not an instance of MySQLMasterPos" );
                }
 
-               if ( $this->lastKnownSlavePos && $this->lastKnownSlavePos->hasReached( $pos ) ) {
-                       return 0;
+               if ( $this->getLBInfo( 'is static' ) === true ) {
+                       return 0; // this is a copy of a read-only dataset with no master DB
+               } elseif ( $this->lastKnownSlavePos && $this->lastKnownSlavePos->hasReached( $pos ) ) {
+                       return 0; // already reached this point for sure
                }
 
                # Commit any open transactions
@@ -863,6 +865,14 @@ abstract class DatabaseMysqlBase extends Database {
                return "FORCE INDEX (" . $this->indexName( $index ) . ")";
        }
 
+       /**
+        * @param string $index
+        * @return string
+        */
+       function ignoreIndexClause( $index ) {
+               return "IGNORE INDEX (" . $this->indexName( $index ) . ")";
+       }
+
        /**
         * @return string
         */