From 2bfc808d03fc3447f26340cc3a55856679a8afb9 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 7 May 2015 09:36:47 -0400 Subject: [PATCH] ApiQueryRevisions: Remove bogus query optimization The attempted optimization was bringing back bad assumptions about the equivalence of ordering by rev_id and rev_timestamp. Bug: T98467 Change-Id: I71bae11349c3fde328711e8cc2aac135eae72123 --- includes/api/ApiQueryRevisions.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 9e02551f76..0282fc593c 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -227,20 +227,6 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase { ); } - // Query optimization: since we're targeting ranges of - // rev_timestamp,rev_id, if we're given an id then extract the - // corresponding timestamp from the DB. - // Note we don't use Revision::getTimestampFromId() since we don't - // have a Title to pass it and there's not any real need to create one. - if ( $params['startid'] !== null ) { - $params['start'] = $db->selectField( 'revision', 'rev_timestamp', - array( 'rev_id' => $params['startid'] ), __METHOD__ ); - } - if ( $params['endid'] !== null ) { - $params['end'] = $db->selectField( 'revision', 'rev_timestamp', - array( 'rev_id' => $params['endid'] ), __METHOD__ ); - } - $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'], $params['start'], $params['end'] ); $this->addWhereRange( 'rev_id', $params['dir'], -- 2.20.1