Revert 15696, would cause every DB to fail other than mysql. Huh?
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 16 Jul 2006 21:40:35 +0000 (21:40 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 16 Jul 2006 21:40:35 +0000 (21:40 +0000)
includes/Article.php

index 716a0f9..6416889 100644 (file)
@@ -1910,28 +1910,29 @@ class Article {
                );
 
                # Now that it's safely backed up, delete it
+               $dbw->delete( 'revision', array( 'rev_page' => $id ), __METHOD__ );
                $dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__);
 
-               if ($wgDBtype == 'mysql') {
-                       $dbw->delete( 'revision', array( 'rev_page' => $id ), __METHOD__ );
-                       if ($wgUseTrackbacks)
-                               $dbw->delete( 'trackbacks', array( 'tb_page' => $id ), __METHOD__ );
+               if ($wgUseTrackbacks)
+                       $dbw->delete( 'trackbacks', array( 'tb_page' => $id ), __METHOD__ );
 
-                       # Clean up recentchanges entries...
-                       $dbw->delete( 'recentchanges', array( 'rc_namespace' => $ns, 'rc_title' => $t ), __METHOD__ );
+               # Clean up recentchanges entries...
+               $dbw->delete( 'recentchanges', array( 'rc_namespace' => $ns, 'rc_title' => $t ), __METHOD__ );
 
-                       # Delete outgoing links
-                       $dbw->delete( 'pagelinks', array( 'pl_from' => $id ) );
-                       $dbw->delete( 'imagelinks', array( 'il_from' => $id ) );
-                       $dbw->delete( 'categorylinks', array( 'cl_from' => $id ) );
-                       $dbw->delete( 'templatelinks', array( 'tl_from' => $id ) );
-                       $dbw->delete( 'externallinks', array( 'el_from' => $id ) );
-                       $dbw->delete( 'langlinks', array( 'll_from' => $id ) );
-               }
+               # Finally, clean up the link tables
+               $t = $this->mTitle->getPrefixedDBkey();
 
                # Clear caches
                Article::onArticleDelete( $this->mTitle );
 
+               # Delete outgoing links
+               $dbw->delete( 'pagelinks', array( 'pl_from' => $id ) );
+               $dbw->delete( 'imagelinks', array( 'il_from' => $id ) );
+               $dbw->delete( 'categorylinks', array( 'cl_from' => $id ) );
+               $dbw->delete( 'templatelinks', array( 'tl_from' => $id ) );
+               $dbw->delete( 'externallinks', array( 'el_from' => $id ) );
+               $dbw->delete( 'langlinks', array( 'll_from' => $id ) );
+
                # Log the deletion
                $log = new LogPage( 'delete' );
                $log->addEntry( 'delete', $this->mTitle, $reason );