Remove some individual transactions
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 19 Sep 2008 10:13:32 +0000 (10:13 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 19 Sep 2008 10:13:32 +0000 (10:13 +0000)
includes/Article.php
includes/SiteStats.php
includes/Title.php
includes/specials/SpecialUndelete.php

index c0ff600..7d4b816 100644 (file)
@@ -1659,9 +1659,7 @@ class Article {
                $return = Title::makeTitle( NS_SPECIAL, $returnto );
 
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin();
                $errors = $rc->doMarkPatrolled();
-               $dbw->commit();
 
                if ( in_array(array('rcpatroldisabled'), $errors) ) {
                        $wgOut->showErrorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
@@ -3015,7 +3013,6 @@ class Article {
                wfProfileIn( __METHOD__ );
 
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin();
                $revision = new Revision( array(
                        'page'       => $this->getId(),
                        'text'       => $text,
@@ -3024,7 +3021,6 @@ class Article {
                        ) );
                $revision->insertOn( $dbw );
                $this->updateRevisionOn( $dbw, $revision );
-               $dbw->commit();
 
                wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
 
@@ -3453,13 +3449,7 @@ class Article {
                        if ( count( $templates_diff ) > 0 ) {
                                # Whee, link updates time.
                                $u = new LinksUpdate( $this->mTitle, $parserOutput );
-
-                               $dbw = wfGetDb( DB_MASTER );
-                               $dbw->begin();
-
                                $u->doUpdate();
-
-                               $dbw->commit();
                        }
                }
 
index e209cc2..3729f45 100644 (file)
@@ -227,12 +227,12 @@ class SiteStatsUpdate {
                                $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') );
                                list( $page, $user ) = $dbr->tableNamesN( 'page', 'user' );
 
-                               $sql = "SELECT COUNT(page_namespace) AS total FROM $page";
+                               $sql = "SELECT COUNT(*) AS total FROM $page";
                                $res = $dbr->query( $sql, $fname );
                                $pageRow = $dbr->fetchObject( $res );
                                $pages = $pageRow->total + $this->mPages;
 
-                               $sql = "SELECT COUNT(user_id) AS total FROM $user";
+                               $sql = "SELECT COUNT(*) AS total FROM $user";
                                $res = $dbr->query( $sql, $fname );
                                $userRow = $dbr->fetchObject( $res );
                                $users = $userRow->total + $this->mUsers;
@@ -249,9 +249,7 @@ class SiteStatsUpdate {
                if ( $updates ) {
                        $site_stats = $dbw->tableName( 'site_stats' );
                        $sql = $dbw->limitResultForUpdate("UPDATE $site_stats SET $updates", 1);
-                       $dbw->begin();
                        $dbw->query( $sql, $fname );
-                       $dbw->commit();
                }
        }
        
@@ -262,11 +260,9 @@ class SiteStatsUpdate {
                $activeUsers = $dbr->selectField( 'recentchanges', 'COUNT( DISTINCT rc_user_text )',
                        array( 'rc_user != 0', 'rc_bot' => 0, "rc_log_type != 'newusers'" ),
                        __METHOD__ );
-               $dbw->begin();
                $dbw->update( 'site_stats', 
                        array( 'ss_active_users' => intval($activeUsers) ),
                        array( 'ss_row_id' => 1 ), __METHOD__, array( 'LIMIT' => 1 )
                );
-               $dbw->commit();
        }
 }
index 2213396..2639e9f 100644 (file)
@@ -2679,7 +2679,6 @@ class Title {
                $latest = $this->getLatestRevID();
 
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin();
 
                # Delete the old redirect. We don't save it to history since
                # by definition if we've got here it's rather uninteresting.
@@ -2759,7 +2758,6 @@ class Title {
                                }
                        }
                }
-               $dbw->commit();
 
                # Log the move
                $log = new LogPage( 'move' );
@@ -2796,7 +2794,6 @@ class Title {
                $latest = $this->getLatestRevId();
                
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin();
                $now = $dbw->timestamp();
 
                # Save a null revision in the page's history notifying of the move
@@ -2856,7 +2853,6 @@ class Title {
                                }
                        }
                }
-               $dbw->commit();
 
                # Log the move
                $log = new LogPage( 'move' );
index ecd7d4c..cfff82f 100644 (file)
@@ -481,7 +481,6 @@ class PageArchive {
                        $ret->seek( 0 );
                }
 
-               $dbw->begin();
                if( $makepage ) {
                        $newid  = $article->insertOn( $dbw );
                        $pageId = $newid;
@@ -565,7 +564,6 @@ class PageArchive {
                        return self::UNDELETE_UNKNOWNERR;
                }
 
-               $dbw->commit();
                return $restored;
        }