From: Brad Jorsch Date: Thu, 7 May 2015 13:36:47 +0000 (-0400) Subject: ApiQueryRevisions: Remove bogus query optimization X-Git-Tag: 1.31.0-rc.0~11095^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=2bfc808d03fc3447f26340cc3a55856679a8afb9;p=lhc%2Fweb%2Fwiklou.git 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 --- 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'],