Partial revert of r53641 "* (bug 19857) maintenance/deleteRevision.php on last revisi...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 22:51:21 +0000 (22:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 22:51:21 +0000 (22:51 +0000)
Unindexed query would scan entire page table.

RELEASE-NOTES
maintenance/deleteRevision.php

index e309120..64fa73c 100644 (file)
@@ -353,8 +353,6 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 19839) Comments in log items are no more double escaped
 * (bug 18161) Fix inconsistent separators in watchlist link toolbars with
   "enhanced recent changes"
-* (bug 19857) maintenance/deleteRevision.php on last revision no longer breaks
-  target page
 * (bug 16877) Moving a page over a redirect no longer leaves an orphan entry in
   the recentchanges table
 * (bug 16009) Limit selection forms based on Pager now links to the correct page
index dd8bf13..980b0c3 100644 (file)
@@ -64,13 +64,6 @@ class DeleteRevision extends Maintenance {
                        } else {
                                $affected += $dbw->affectedRows();
                                $dbw->delete( 'revision', array( 'rev_id' => $revID ) );
-                               
-                               // Database integrity
-                               $pageID = $dbw->selectField( 'page', 'page_id', array( 'page_latest' => $revID ), __METHOD__ );
-                               if ( $pageID ) {
-                                       $newLatest = $dbw->selectField( 'revision', 'rev_id', array( 'rev_page' => $pageID ), __METHOD__, array( 'ORDER BY' => 'rev_timestamp DESC' ) );
-                                       $dbw->update( 'page', array( 'page_latest' => $newLatest ), array( 'page_id' => $pageID ), __METHOD__ );
-                               }
                        }
                }
                $this->output( "Deleted $affected revisions\n" );