r79699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79698‎ | r79699 | r79700 >
Date:01:23, 6 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Fixup nasty way of listing tables and left joining in other tables. Use better join_conds syntax
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -94,11 +94,8 @@
9595 $conds[] = 'user_editcount > 0';
9696 }
9797
98 - list ($user,$user_groups,$ipblocks) = $dbr->tableNamesN('user','user_groups','ipblocks');
99 -
10098 $query = array(
101 - 'tables' => " $user $useIndex LEFT JOIN $user_groups ON user_id=ug_user
102 - LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0 ",
 99+ 'tables' => array( 'user', 'user_groups', 'ipblocks'),
103100 'fields' => array(
104101 $this->creationSort ? 'MAX(user_name) AS user_name' : 'user_name',
105102 $this->creationSort ? 'user_id' : 'MAX(user_id) AS user_id',
@@ -109,6 +106,10 @@
110107 'MAX(ipb_deleted) AS ipb_deleted' // block/hide status
111108 ),
112109 'options' => array('GROUP BY' => $this->creationSort ? 'user_id' : 'user_name'),
 110+ 'join_conds' => array(
 111+ 'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ),
 112+ 'ipblocks' => array( 'LEFT JOIN', 'user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0' ),
 113+ ),
113114 'conds' => $conds
114115 );
115116

Status & tagging log