From 84f34c7a09a71a9e5f01ddf451d4c0c98e980ee8 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 10 Feb 2010 00:41:59 +0000 Subject: [PATCH] Fix for r56885, r58364, r58364: use a two-part GROUP BY even on MySQL. The implicit sort shouldn't cause any problems here. Query runs without errors on MySQL (with or without ONLY_FULL_GROUP_BY), SQLite and PostgreSQL. The previous version in the non-MySQL case was plainly broken, see CR r58915. --- includes/specials/SpecialActiveusers.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index a5f1b3c109..7d907fb50d 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -68,8 +68,6 @@ class ActiveUsersPager extends UsersPager { } function getQueryInfo() { - global $wgDBtype; - $dbr = wfGetDB( DB_SLAVE ); $conds = array( 'rc_user > 0' ); // Users - no anons $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names @@ -83,12 +81,12 @@ class ActiveUsersPager extends UsersPager { 'tables' => array( 'recentchanges', 'user', 'ipblocks' ), 'fields' => array( 'rc_user_text AS user_name', // inheritance 'rc_user_text', // for Pager - 'MAX(user_id) AS user_id', + 'user_id', 'COUNT(*) AS recentedits', 'MAX(ipb_user) AS blocked' ), 'options' => array( - 'GROUP BY' => ( $dbr->implicitGroupby() || $wgDBtype == 'sqlite' ) ? 'rc_user_text' : 'rc_user_text, user_id', + 'GROUP BY' => 'rc_user_text, user_id', 'USE INDEX' => array( 'recentchanges' => 'rc_user_text' ) ), 'join_conds' => array( -- 2.20.1