Merge "List deleted revisions in well defined order"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 10 Jul 2018 15:05:27 +0000 (15:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 10 Jul 2018 15:05:27 +0000 (15:05 +0000)
1  2 
includes/page/PageArchive.php

@@@ -203,10 -203,10 +203,10 @@@ class PageArchive 
                        'ar_title' => $this->title->getDBkey(),
                ];
  
-               // TODO: ORDER BY ar_timestamp DESC, ar_rev_id DESC, to remove ambiguity.
-               // HOWEVER this requires  ar_rev_id to be added to the name_title_timestamp index first!
-               // Otherwise, adding this ar_rev_id to the order will result in a file sort!
-               $options = [ 'ORDER BY' => 'ar_timestamp DESC' ];
+               // NOTE: ordering by ar_timestamp and ar_id, to remove ambiguity.
+               // XXX: Ideally, we would be ordering by ar_timestamp and ar_rev_id, but since we
+               // don't have an index on ar_rev_id, that causes a file sort.
+               $options = [ 'ORDER BY' => 'ar_timestamp DESC, ar_id DESC' ];
  
                ChangeTags::modifyDisplayQuery(
                        $queryInfo['tables'],
         * @param string $comment
         * @param array $fileVersions
         * @param bool $unsuppress
 -       * @param User $user User performing the action, or null to use $wgUser
 -       * @param string|string[] $tags Change tags to add to log entry
 +       * @param User|null $user User performing the action, or null to use $wgUser
 +       * @param string|string[]|null $tags Change tags to add to log entry
         *   ($user should be able to add the specified tags before this is called)
         * @return array|bool array(number of file revisions restored, number of image revisions
         *   restored, log message) on success, false on failure.