r73881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73880‎ | r73881 | r73882 >
Date:11:39, 28 September 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
Sanity check on result from SHOW PROCESSLIST, foreach -> while (sorta followup to r68878)
Modified paths:
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -321,8 +321,11 @@
322322 return $this->mFakeSlaveLag;
323323 }
324324 $res = $this->query( 'SHOW PROCESSLIST', __METHOD__ );
 325+ if( !$res ) {
 326+ return false;
 327+ }
325328 # Find slave SQL thread
326 - while ( $row = $this->fetchObject( $res ) ) {
 329+ foreach( $res as $row ) {
327330 /* This should work for most situations - when default db
328331 * for thread is not specified, it had no events executed,
329332 * and therefore it doesn't know yet how lagged it is.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68878Refactored Database*::getLag(): moved the default implementation to MySQL, re...maxsem13:17, 2 July 2010

Comments

#Comment by 😂 (talk | contribs)   11:40, 28 September 2010

while -> foreach, of course.

Status & tagging log