http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73881

Revision: 73881
Author:   demon
Date:     2010-09-28 11:39:10 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Sanity check on result from SHOW PROCESSLIST, foreach -> while (sorta followup 
to r68878)

Modified Paths:
--------------
    trunk/phase3/includes/db/DatabaseMysql.php

Modified: trunk/phase3/includes/db/DatabaseMysql.php
===================================================================
--- trunk/phase3/includes/db/DatabaseMysql.php  2010-09-28 11:12:56 UTC (rev 
73880)
+++ trunk/phase3/includes/db/DatabaseMysql.php  2010-09-28 11:39:10 UTC (rev 
73881)
@@ -321,8 +321,11 @@
                        return $this->mFakeSlaveLag;
                }
                $res = $this->query( 'SHOW PROCESSLIST', __METHOD__ );
+               if( !$res ) {
+                       return false;
+               }
                # Find slave SQL thread
-               while ( $row = $this->fetchObject( $res ) ) {
+               foreach( $res as $row ) {
                        /* This should work for most situations - when default 
db
                         * for thread is not specified, it had no events 
executed,
                         * and therefore it doesn't know yet how lagged it is.



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to