(bug 40353) SpecialDoubleRedirect: Fix for interwiki redirects
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 19 Sep 2012 12:20:32 +0000 (14:20 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Wed, 19 Sep 2012 13:22:52 +0000 (15:22 +0200)
commitfc57cf6d5ba2d6e4c092f4c823d3bc019f5c8c83
tree5f64b2c0ae5a66c8d53e9201e08632da53ee2274
parent6518ffba8de49e687a114d28aa919f49a3845af6
(bug 40353) SpecialDoubleRedirect: Fix for interwiki redirects

Previously there were problems:
- Non-double redirects that point to interwiki of the same name
  were also included (because it ignored rd_interwiki, it looked
  up a local page by that name and found a redirect, again etc.)

  e.g.:
  "Foo (edit) →‎ Foo →‎ somewiki:Foo"

- Double redirects that end in an interwiki appeared to be
  linking to a local one

  "X (edit) →‎ Y →‎ Y" // the second Y is really somewiki:Y

- Double redirects where the end is an interwiki and of a
  different title, are not included in the results.

- Redundant third join to page (pc), the information needed from
  that table (title, namespace) are already available in the
  redirect table. Redundant joins are generally not a bug, but
  in this case the third join caused interwiki targets to be
  excluded in most cases since those external pages did not
  exist in the local table (except for coincidences).

Example wiki:
* Foo redirects to somewiki:Foo
* X redirects to Y
* Y redirects to somewiki:Y
* A redirects to B
* B redirects to somewiki:C

Before (http://sqlfiddle.com/#!2/1d656/9/0):

* Foo →‎ Foo →‎ Foo

* X →‎ Y →‎ Y

After (http://sqlfiddle.com/#!2/1d656/6/0):

* X →‎ Y →‎ somewiki:Y

* A →‎ B →‎ somewiki:C

Change-Id: I986f3a03d71dd6457842e6189653bd606f4fa97e
RELEASE-NOTES-1.20
includes/specials/SpecialDoubleRedirects.php