r44340 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44339‎ | r44340 | r44341 >
Date:15:00, 9 December 2008
Author:werdna
Status:ok
Tags:
Comment:
DB layer compatibility with MySQL 5+ - allow both >Exec_master_log_pos and ->Exec_Master_Log_Pos in SHOW SLAVE STATUS.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -1931,7 +1931,8 @@
19321932 $res = $this->query( 'SHOW SLAVE STATUS', 'Database::getSlavePos' );
19331933 $row = $this->fetchObject( $res );
19341934 if ( $row ) {
1935 - return new MySQLMasterPos( $row->Relay_Master_Log_File, $row->Exec_master_log_pos );
 1935+ $pos = isset($row->Exec_master_log_pos) ? $row->Exec_master_log_pos : $row->Exec_Master_Log_Pos;
 1936+ return new MySQLMasterPos( $row->Relay_Master_Log_File, $pos );
19361937 } else {
19371938 return false;
19381939 }

Status & tagging log