API: Convert rvstartid/rvendid to timestamps for query
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 21 Apr 2017 15:00:14 +0000 (11:00 -0400)
committerTim Starling <tstarling@wikimedia.org>
Mon, 8 May 2017 05:47:01 +0000 (05:47 +0000)
commite72256a6d970ab9d03d0278ed69f73d189fc0160
tree155ff3dd6a580104616fe3279dffb202d77cfe10
parent80479a45f588fa4f853e309abb5c85cb00156103
API: Convert rvstartid/rvendid to timestamps for query

We tried something like this once before, but reverted it because it was
an unintended behavior change (see T98467). This time it's intended, we
need it for query optimization.

The behavior changes here are:
* rvstartid/rvendid is exactly equivalent to specifying rvstart/rvend
  with the corresponding revisions' timestamps.
* If the revision for rvstartid/rvendid is not found in the database, an
  error will be thrown.

This will pull timestamps from deleted revisions, i.e. the `archive`
table. While this is technically an information leak (that some revision
ID exists as a deleted revision and the time the revision was made),
it's minor and in line with the information revealed in Tool Labs thanks
to T51088.

Bug: T163532
Change-Id: Ida64a377c38b3553aa82ac754d80e8f898caf6c5
includes/api/ApiQueryRevisions.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json