From 985fc5226d1a5f21a177b74a10cfab7fbb11168d Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 6 Jan 2014 19:39:39 +0100 Subject: [PATCH] Specify DBMasterPos::getMasterPos() Change-Id: Id6268193d08737e2599ec84496527b3be348dfda --- includes/db/DatabaseMysqlBase.php | 9 ++++++++- includes/db/DatabaseUtility.php | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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(); } -- 2.20.1