Fix revision table cleanup on delete
authorTim Starling <tstarling@wikimedia.org>
Fri, 4 Oct 2013 04:35:13 +0000 (14:35 +1000)
committerTim Starling <tstarling@wikimedia.org>
Fri, 4 Oct 2013 04:35:13 +0000 (14:35 +1000)
commitd3364da9cea7f8bb0b41611f44d185c51f6dd73c
tree783b4a4f3e6e2cc90a44a7841e1ba0e2bfaeb1ad
parent72388938ca103edc1068ee7873f145be9f2360e5
Fix revision table cleanup on delete

The ContentHandler branch inappropriately moved this essential
query to content-type-dependent code, despite the fact that revision
table cleanup needs to be done independently of content type. Before
r15707, the revision query was done immediately before the page query,
but it was moved down to allow it to be brought into the same
if (!$dbw->cascadingDeletes() ) block as the link updates. I have moved
it to immediately after the page delete, so that the rollback which has
since been added will not affect the expensive revision table query.

This should fix the database corruption we are seeing on some page
deletions (13 affected pages on enwiki, 14 on nlwiki, etc.)

Bug: 53687
Change-Id: I7a54c4416be07fb8cc7a5698e77927ccb24cbd6e
includes/LinksUpdate.php
includes/WikiPage.php