From b7e741b709ea1a840cba6d4b2bcafa8c4315790f Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Mon, 19 Aug 2019 21:57:32 +0200 Subject: [PATCH] Simplify NewFilesPager::getQueryInfo The query here is not used for the images to display, so the query must not include all columns from the images table, because that is not used The gallery itself will load the necessary information for the display in separate queries Bug: T227608 Change-Id: I70b0d1bcdc155c38d69b5dd52bf4e3898920ab76 --- includes/specials/pagers/NewFilesPager.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/specials/pagers/NewFilesPager.php b/includes/specials/pagers/NewFilesPager.php index be4a1bdf1e..9a78c5dda7 100644 --- a/includes/specials/pagers/NewFilesPager.php +++ b/includes/specials/pagers/NewFilesPager.php @@ -64,11 +64,11 @@ class NewFilesPager extends RangeChronologicalPager { function getQueryInfo() { $opts = $this->opts; $conds = []; - $imgQuery = LocalFile::getQueryInfo(); - $tables = $imgQuery['tables']; - $fields = [ 'img_name', 'img_timestamp' ] + $imgQuery['fields']; + $actorQuery = ActorMigration::newMigration()->getJoin( 'img_user' ); + $tables = [ 'image' ] + $actorQuery['tables']; + $fields = [ 'img_name', 'img_timestamp' ] + $actorQuery['fields']; $options = []; - $jconds = $imgQuery['joins']; + $jconds = $actorQuery['joins']; $user = $opts->getValue( 'user' ); if ( $user !== '' ) { @@ -89,7 +89,7 @@ class NewFilesPager extends RangeChronologicalPager { 'LEFT JOIN', [ 'ug_group' => $groupsWithBotPermission, - 'ug_user = ' . $imgQuery['fields']['img_user'], + 'ug_user = ' . $actorQuery['fields']['img_user'], 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) ] ]; @@ -107,7 +107,7 @@ class NewFilesPager extends RangeChronologicalPager { 'JOIN', [ 'rc_title = img_name', - 'rc_actor = ' . $imgQuery['fields']['img_actor'], + 'rc_actor = ' . $actorQuery['fields']['img_actor'], 'rc_timestamp = img_timestamp' ] ]; -- 2.20.1