Specify DBMasterPos::getMasterPos()
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 6 Jan 2014 18:39:39 +0000 (19:39 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 6 Jan 2014 19:02:20 +0000 (20:02 +0100)
Change-Id: Id6268193d08737e2599ec84496527b3be348dfda

includes/db/DatabaseMysqlBase.php
includes/db/DatabaseUtility.php

index 587d727..091896c 100644 (file)
@@ -681,7 +681,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
 
                # Call doQuery() directly, to avoid opening a transaction if DBO_TRX is set
                $encFile = $this->addQuotes( $pos->file );
-               $encPos = intval( $pos->pos );
+               $encPos = intval( $pos->getMasterPos() );
                $sql = "SELECT MASTER_POS_WAIT($encFile, $encPos, $timeout)";
                $res = $this->doQuery( $sql );
 
@@ -1255,4 +1255,11 @@ class MySQLMasterPos implements DBMasterPos {
 
                return ( $thisPos && $thatPos && $thisPos >= $thatPos );
        }
+
+       /**
+        * @return int
+        */
+       public function getMasterPos() {
+               return $this->pos;
+       }
 }
index 7d36a38..2b4b634 100644 (file)
@@ -328,4 +328,10 @@ class LikeMatch {
  * An object representing a master or slave position in a replicated setup.
  */
 interface DBMasterPos {
+       /**
+        * Return the master position.
+        *
+        * @return mixed Master position
+        */
+       public function getMasterPos();
 }