From 8f45d13fe12f40396a564f24fce48c7d8cf80b26 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 Feb 2018 17:18:00 -0800 Subject: [PATCH] rdbms: remove obsolete getReplicaPos() code Also fixed incorrect comment for getGtidCoordinates() Change-Id: Ie2ce8a8bba230ceb6d068957e5ffeb360c3fe473 --- includes/libs/rdbms/database/DatabaseMysqlBase.php | 4 +--- includes/libs/rdbms/database/position/MySQLMasterPos.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 6a545ceb2d..208f506520 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -942,9 +942,7 @@ abstract class DatabaseMysqlBase extends Database { $row = $this->fetchObject( $res ); if ( $row ) { - $pos = isset( $row->Exec_master_log_pos ) - ? $row->Exec_master_log_pos - : $row->Exec_Master_Log_Pos; + $pos = $row->Exec_Master_Log_Pos; // Also fetch the last-applied GTID set (MariaDB) if ( $this->useGTIDs ) { $res = $this->query( "SHOW GLOBAL VARIABLES LIKE 'gtid_slave_pos'", __METHOD__ ); diff --git a/includes/libs/rdbms/database/position/MySQLMasterPos.php b/includes/libs/rdbms/database/position/MySQLMasterPos.php index 0657cf3dc0..9ca6b111eb 100644 --- a/includes/libs/rdbms/database/position/MySQLMasterPos.php +++ b/includes/libs/rdbms/database/position/MySQLMasterPos.php @@ -99,7 +99,7 @@ class MySQLMasterPos implements DBMasterPos { * @note: this returns false for multi-source replication GTID sets * @see https://mariadb.com/kb/en/mariadb/gtid * @see https://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html - * @return array Map of (domain => integer position) or false + * @return array Map of (domain => integer position); possibly empty */ protected function getGtidCoordinates() { $gtidInfos = []; -- 2.20.1