From da5774970f53c1405c4a3b5c8ef109e6a12cf9a8 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 23 Feb 2011 12:27:06 +0000 Subject: [PATCH] Fixup SpecialListusers, $useIndex wasn't being used in the query, so make it be --- includes/specials/SpecialListusers.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 144b08bbc8..a8553d5ae1 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -74,13 +74,16 @@ class UsersPager extends AlphabeticPager { $dbr = wfGetDB( DB_SLAVE ); $conds = array(); // Don't show hidden names - if( !$wgUser->isAllowed('hideuser') ) + if( !$wgUser->isAllowed('hideuser') ) { $conds[] = 'ipb_deleted IS NULL'; + } + + $options = array(); + if( $this->requestedGroup != '' ) { $conds['ug_group'] = $this->requestedGroup; - $useIndex = ''; } else { - $useIndex = $dbr->useIndexClause( $this->creationSort ? 'PRIMARY' : 'user_name'); + $options['USE INDEX'] = $this->creationSort ? 'PRIMARY' : 'user_name'; } if( $this->requestedUser != '' ) { # Sorted either by account creation or name @@ -94,6 +97,8 @@ class UsersPager extends AlphabeticPager { $conds[] = 'user_editcount > 0'; } + $options['GROUP BY'] = $this->creationSort ? 'user_id' : 'user_name'; + $query = array( 'tables' => array( 'user', 'user_groups', 'ipblocks'), 'fields' => array( @@ -105,7 +110,7 @@ class UsersPager extends AlphabeticPager { 'MIN(user_registration) AS creation', 'MAX(ipb_deleted) AS ipb_deleted' // block/hide status ), - 'options' => array('GROUP BY' => $this->creationSort ? 'user_id' : 'user_name'), + 'options' => $options, 'join_conds' => array( 'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ), 'ipblocks' => array( 'LEFT JOIN', 'user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0' ), -- 2.20.1