r53526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53525‎ | r53526 | r53527 >
Date:04:53, 20 July 2009
Author:aaron
Status:ok
Tags:
Comment:
* Query fixes
* Don't count account creations (bug 19616)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialActiveusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialActiveusers.php
@@ -49,6 +49,7 @@
5050 $dbr = wfGetDB( DB_SLAVE );
5151 $conds = array('rc_user > 0'); // Users - no anons
5252 $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names
 53+ $conds[] = 'rc_log_type IS NULL OR rc_log_type != "newusers"';
5354 $useIndex = $dbr->useIndexClause( 'rc_user_text' );
5455 if( $this->requestedUser != '' ) {
5556 $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser );
@@ -57,12 +58,12 @@
5859 list( $recentchanges, $ipblocks, $user ) = $dbr->tableNamesN( 'recentchanges', 'ipblocks', 'user' );
5960
6061 $query = array(
61 - 'tables' => " $recentchanges $useIndex
62 - LEFT JOIN $ipblocks ON rc_user=ipb_user AND ipb_auto=0 AND ipb_deleted=1
63 - INNER JOIN $user ON rc_user=user_id ",
 62+ 'tables' => "$recentchanges $useIndex
 63+ INNER JOIN $user ON rc_user_text=user_name
 64+ LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 AND ipb_deleted=1 ",
6465 'fields' => array( 'rc_user_text AS user_name', // inheritance
6566 'rc_user_text', // for Pager
66 - 'MAX(rc_user) AS user_id',
 67+ 'user_id',
6768 'COUNT(*) AS recentedits',
6869 'MAX(ipb_user) AS blocked' ),
6970 'options' => array( 'GROUP BY' => 'rc_user_text' ),

Status & tagging log