From: Brion Vibber Date: Sun, 16 Jul 2006 21:40:35 +0000 (+0000) Subject: Revert 15696, would cause every DB to fail other than mysql. Huh? X-Git-Tag: 1.31.0-rc.0~56196 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=9605e39cb9831564ea59ae5fea0489595f45d49f;p=lhc%2Fweb%2Fwiklou.git Revert 15696, would cause every DB to fail other than mysql. Huh? --- diff --git a/includes/Article.php b/includes/Article.php index 716a0f9be6..64168896a0 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 );