From: Brad Jorsch Date: Wed, 12 Dec 2018 15:31:40 +0000 (-0500) Subject: ImageListPager: Don't query by oi_user X-Git-Tag: 1.34.0-rc.0~3271 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=c969d0c5650bc1805d1a0ef1da839cda2faafb0f;p=lhc%2Fweb%2Fwiklou.git 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 --- 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']; }