From d969a278b7b0b2b712a1cef4bf79d9ee5e71fe0f Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 19 Jun 2012 15:01:38 -0700 Subject: [PATCH] Removed half-assed $wgDBtransactions global. Change-Id: I5211ec50622b0a40bf4756b7fe735dc669f928e7 --- RELEASE-NOTES-1.20 | 4 ++++ includes/DefaultSettings.php | 3 --- includes/WikiPage.php | 16 +--------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index f3e6c7ecbf..2729aee709 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -161,6 +161,10 @@ changes to languages because of Bugzilla reports. * Removed ./tests/qunit/index.html from core. It wasn't actively maintained and has been made obsolete when [[Special:JavaScriptTest/qunit]] was introduced, which actually uses ResourceLoader, LocalSettings and the Skin. +* Removed $wgDBtransactions global. This was only checked in one class + and only applies to MyISAM or similar DBs. Those should only be used + for archived sites anyway. We can't get edit conflicts on such sites, + so the WikiPage code wasn't useful there either. == Compatibility == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c2606ce826..6e59a86eb9 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1381,9 +1381,6 @@ $wgDBClusterTimeout = 10; */ $wgDBAvgStatusPoll = 2000; -/** Set to true if using InnoDB tables */ -$wgDBtransactions = false; - /** * Set to true to engage MySQL 4.1/5.0 charset-related features; * for now will just cause sending of 'SET NAMES=utf8' on connect. diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 40e0ec3b99..c203e4fbf4 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -1445,7 +1445,7 @@ class WikiPage extends Page { * Compatibility note: this function previously returned a boolean value indicating success/failure */ public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) { - global $wgUser, $wgDBtransactions, $wgUseAutomaticEditSummaries; + global $wgUser, $wgUseAutomaticEditSummaries; # Low-level sanity check if ( $this->mTitle->getText() === '' ) { @@ -1513,11 +1513,6 @@ class WikiPage extends Page { return $status; } - # Make sure the revision is either completely inserted or not inserted at all - if ( !$wgDBtransactions ) { - $userAbort = ignore_user_abort( true ); - } - $revision = new Revision( array( 'page' => $this->getId(), 'comment' => $summary, @@ -1548,11 +1543,6 @@ class WikiPage extends Page { /* Belated edit conflict! Run away!! */ $status->fatal( 'edit-conflict' ); - # Delete the invalid revision if the DB is not transactional - if ( !$wgDBtransactions ) { - $dbw->delete( 'revision', array( 'rev_id' => $revisionId ), __METHOD__ ); - } - $revisionId = 0; $dbw->rollback( __METHOD__ ); } else { @@ -1583,10 +1573,6 @@ class WikiPage extends Page { $revision->setId( $this->getLatest() ); } - if ( !$wgDBtransactions ) { - ignore_user_abort( $userAbort ); - } - // Now that ignore_user_abort is restored, we can respond to fatal errors if ( !$status->isOK() ) { wfProfileOut( __METHOD__ ); -- 2.20.1