Remove use of implicitGroupBy() in ActiveUsersPager
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 9 Sep 2017 21:33:38 +0000 (14:33 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 9 Sep 2017 21:33:38 +0000 (14:33 -0700)
Bug: T160298
Change-Id: Id8963924f036e9ed3fcdde3a8e54b7126b72356e

includes/specials/pagers/ActiveUsersPager.php

index 0665e11..64af71a 100644 (file)
@@ -118,16 +118,15 @@ class ActiveUsersPager extends UsersPager {
                                ) . ')';
                }
 
-               if ( $dbr->implicitGroupby() ) {
-                       $options = [ 'GROUP BY' => [ 'qcc_title' ] ];
-               } else {
-                       $options = [ 'GROUP BY' => [ 'user_name', 'user_id', 'qcc_title' ] ];
-               }
-
                return [
                        'tables' => $tables,
-                       'fields' => [ 'user_name', 'user_id', 'recentedits' => 'COUNT(*)', 'qcc_title' ],
-                       'options' => $options,
+                       'fields' => [
+                               'qcc_title',
+                               'user_name' => 'qcc_title',
+                               'user_id' => 'MAX(user_id)',
+                               'recentedits' => 'COUNT(*)'
+                       ],
+                       'options' => [ 'GROUP BY' => [ 'qcc_title' ] ],
                        'conds' => $conds
                ];
        }