From be3c297852060b0138210bc7e803a35aa6b23678 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Tue, 25 Feb 2025 17:49:31 -0700 Subject: [PATCH] initEditCount: Join from user to actor to revision Correct the join conditions used to find the current edit count for a batch of users. Follows up b98f33c where the incorrect join order and conditions were introduced as part of migration to QueryBuilder syntax. Change-Id: I1841bb074b0f2be31e60a3cce3d62eb1b5999ad0 (cherry picked from commit 834891e01afa19cc1ecd973c04a453a9abb2d484) --- maintenance/initEditCount.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maintenance/initEditCount.php b/maintenance/initEditCount.php index 0032d9bd5b5..6ec843edfe6 100644 --- a/maintenance/initEditCount.php +++ b/maintenance/initEditCount.php @@ -72,8 +72,8 @@ class InitEditCount extends Maintenance { $result = $dbr->newSelectQueryBuilder() ->select( [ 'user_id', 'user_editcount' => "COUNT(actor_rev_user.actor_user)" ] ) ->from( 'user' ) - ->leftJoin( 'revision', 'rev', "user_id = actor_rev_user.actor_user" ) - ->join( 'actor', 'actor_rev_user', 'actor_rev_user.actor_id = rev_actor' ) + ->join( 'actor', 'actor_rev_user', 'user_id = actor_rev_user.actor_user' ) + ->leftJoin( 'revision', 'rev', 'actor_rev_user.actor_id = rev.rev_actor' ) ->where( $dbr->expr( 'user_id', '>', $min )->and( 'user_id', '<=', $max ) ) ->groupBy( 'user_id' ) ->caller( __METHOD__ )->fetchResultSet();