From 247904106076b80636ba9f3833a8d1e18be256a7 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Fri, 16 Aug 2019 14:02:56 -0400 Subject: [PATCH] RecentChangesUpdateJob: Fix GROUP BY When a column specified in GROUP BY is both a table column and a SELECT-field, MySQL and PostgreSQL both interpret it as the table column rather than the SELECT-field. In PostgreSQL this raises an error, which is good since it lets us know it needs fixing. But MySQL goes ahead and groups by the table field which gives us the wrong result. Bug: T230618 Change-Id: Id500556b2795b86849329eece3b651b08e29a7f7 --- includes/jobqueue/jobs/RecentChangesUpdateJob.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/jobqueue/jobs/RecentChangesUpdateJob.php b/includes/jobqueue/jobs/RecentChangesUpdateJob.php index 2d4ce34c83..63e6da47ca 100644 --- a/includes/jobqueue/jobs/RecentChangesUpdateJob.php +++ b/includes/jobqueue/jobs/RecentChangesUpdateJob.php @@ -168,7 +168,7 @@ class RecentChangesUpdateJob extends Job { ], __METHOD__, [ - 'GROUP BY' => [ 'rc_user_text' ], + 'GROUP BY' => [ $actorQuery['fields']['rc_user_text'] ], 'ORDER BY' => 'NULL' // avoid filesort ], $actorQuery['joins'] -- 2.20.1