From: Brad Jorsch Date: Fri, 16 Aug 2019 18:02:56 +0000 (-0400) Subject: RecentChangesUpdateJob: Fix GROUP BY X-Git-Tag: 1.34.0-rc.0~696 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=247904106076b80636ba9f3833a8d1e18be256a7;p=lhc%2Fweb%2Fwiklou.git 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 --- 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']