r77269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77268‎ | r77269 | r77270 >
Date:01:16, 25 November 2010
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Reverted garbage from r75443
Modified paths:
  • /trunk/extensions/FlaggedRevs/maintenance/updateStats.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc
@@ -34,7 +34,7 @@
3535 array( 'GROUP BY' => 'page_namespace' ),
3636 array( 'flaggedpages' => array( 'LEFT JOIN', 'fp_page_id = page_id' ) )
3737 );
38 - foreach( $ret as $row ) {
 38+ while ( $row = $dbr->fetchObject( $ret ) ) {
3939 $ns_total[$row->page_namespace] = (int)$row->total;
4040 $ns_reviewed[$row->page_namespace] = (int)$row->reviewed;
4141 $ns_synced[$row->page_namespace] = (int)$row->reviewed - (int)$row->pending;
@@ -234,7 +234,7 @@
235235 if ( $dbr->numRows($res) ) {
236236 $times = array();
237237 # Get the sum of elapsed times
238 - foreach( $res as $row ) {
 238+ while ( $row = $dbr->fetchObject($res) ) {
239239 # Reviewed: just subtract the times (flagged - edit made)
240240 if ( $row->nft != null ) {
241241 $time = wfTimestamp(TS_UNIX,$row->nft) - wfTimestamp(TS_UNIX,$row->rt);

Follow-up revisions

RevisionCommit summaryAuthorDate
r77270MFT r77258, r77260, r77269aaron01:27, 25 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75443Fixup some deprecated calls, swap some whiles to foreachreedy17:10, 26 October 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   01:18, 25 November 2010

Fixed bug 26112

#Comment by Nikerabbit (talk | contribs)   06:38, 25 November 2010

How did it break?

#Comment by Aaron Schulz (talk | contribs)   09:28, 25 November 2010

I talked about this on IRC with Reedy. query() and doQuery() are not the same. The former returns a result wrapper of the later. That wrapper implements Iterator, thus allowing "foreach" on it. The later just returns the mysql_query() result.

Status & tagging log