From: Siebrand Mazeland Date: Mon, 6 Jan 2014 18:39:39 +0000 (+0100) Subject: Specify DBMasterPos::getMasterPos() X-Git-Tag: 1.31.0-rc.0~17307^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=985fc5226d1a5f21a177b74a10cfab7fbb11168d;p=lhc%2Fweb%2Fwiklou.git Specify DBMasterPos::getMasterPos() Change-Id: Id6268193d08737e2599ec84496527b3be348dfda --- diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 587d72718b..091896cd66 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -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; + } } diff --git a/includes/db/DatabaseUtility.php b/includes/db/DatabaseUtility.php index 7d36a38df5..2b4b634138 100644 --- a/includes/db/DatabaseUtility.php +++ b/includes/db/DatabaseUtility.php @@ -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(); }