From c969d0c5650bc1805d1a0ef1da839cda2faafb0f Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 12 Dec 2018 10:31:40 -0500 Subject: [PATCH] ImageListPager: Don't query by oi_user For some reason we have indexes for `image` on `(img_user_text,img_timestamp)` and `(img_user,img_timestamp)`, but for `oldimage` we only have `(oi_user_text,oi_timestamp)`. Thus, when building the query in ImageListPager, we have to be sure to avoid trying to use `oi_user` rather than `oi_user_text` in the WHERE part. Bug: T211774 Change-Id: Ibea058031f1cb3421e92e09f0a705ea00fb22008 --- includes/specials/pagers/ImageListPager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index ab3237ad83..ab38e1a7f3 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -139,7 +139,9 @@ class ImageListPager extends TablePager { $actorWhere = ActorMigration::newMigration()->getWhere( $dbr, $prefix . '_user', - User::newFromName( $this->mUserName, false ) + User::newFromName( $this->mUserName, false ), + // oldimage doesn't have an index on oi_user, while image does. Set $useId accordingly. + $prefix === 'img' ); $conds[] = $actorWhere['conds']; } -- 2.20.1