r60053 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60052‎ | r60053 | r60054 >
Date:23:18, 14 December 2009
Author:demon
Status:ok
Tags:
Comment:
Followup r60051, with the rest of the callers and removing a useless subclassing from DatabaseMssql
Modified paths:
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/maintenance/addwiki.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupSpam.php (modified) (history)
  • /trunk/phase3/maintenance/deleteBatch.php (modified) (history)
  • /trunk/phase3/maintenance/deleteOrphanedRevisions.php (modified) (history)
  • /trunk/phase3/maintenance/moveBatch.php (modified) (history)
  • /trunk/phase3/maintenance/reassignEdits.php (modified) (history)
  • /trunk/phase3/maintenance/refreshLinks.php (modified) (history)
  • /trunk/phase3/maintenance/removeUnusedAccounts.php (modified) (history)
  • /trunk/phase3/maintenance/renamewiki.php (modified) (history)
  • /trunk/phase3/maintenance/updateSpecialPages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/renamewiki.php
@@ -78,7 +78,7 @@
7979 $extdb->query( "ALTER TABLE {$from}.blobs RENAME TO {$to}.blobs" );
8080 $extdb->selectDB( $from );
8181 $extdb->sourceFile( $this->getDir() . '/storage/blobs.sql' );
82 - $extdb->immediateCommit();
 82+ $extdb->commit();
8383 }
8484 }
8585 $this->output( "done.\n" );
Index: trunk/phase3/maintenance/refreshLinks.php
@@ -203,7 +203,7 @@
204204 $parserOutput = $wgParser->parse( $revision->getText(), $wgTitle, $options, true, true, $revision->getId() );
205205 $update = new LinksUpdate( $wgTitle, $parserOutput, false );
206206 $update->doUpdate();
207 - $dbw->immediateCommit();
 207+ $dbw->commit();
208208 }
209209
210210 /*
Index: trunk/phase3/maintenance/moveBatch.php
@@ -94,7 +94,7 @@
9595 if( $err !== true ) {
9696 $this->output( "\nFAILED: $err" );
9797 }
98 - $dbw->immediateCommit();
 98+ $dbw->commit();
9999 $this->output( "\n" );
100100
101101 if ( $interval ) {
Index: trunk/phase3/maintenance/removeUnusedAccounts.php
@@ -95,12 +95,12 @@
9696 'image' => 'img', 'oldimage' => 'oi' );
9797 $count = 0;
9898
99 - $dbo->immediateBegin();
 99+ $dbo->begin();
100100 foreach( $checks as $table => $fprefix ) {
101101 $conds = array( $fprefix . '_user' => $id );
102102 $count += (int)$dbo->selectField( $table, 'COUNT(*)', $conds, __METHOD__ );
103103 }
104 - $dbo->immediateCommit();
 104+ $dbo->commit();
105105
106106 return $count == 0;
107107 }
Index: trunk/phase3/maintenance/updateSpecialPages.php
@@ -122,7 +122,7 @@
123123 $this->output( "Reconnected\n\n" );
124124 } else {
125125 # Commit the results
126 - $dbw->immediateCommit();
 126+ $dbw->commit();
127127 }
128128 # Wait for the slave to catch up
129129 wfWaitForSlaves( 5 );
Index: trunk/phase3/maintenance/deleteBatch.php
@@ -93,7 +93,7 @@
9494 $art = new Article( $page );
9595 }
9696 $success = $art->doDeleteArticle( $reason );
97 - $dbw->immediateCommit();
 97+ $dbw->commit();
9898 if ( $success ) {
9999 $this->output( "\n" );
100100 } else {
Index: trunk/phase3/maintenance/addwiki.php
@@ -118,7 +118,7 @@
119119 $blobsFile = popen( $sedCmd, 'r' );
120120 $extdb->sourceStream( $blobsFile );
121121 pclose( $blobsFile );
122 - $extdb->immediateCommit();
 122+ $extdb->commit();
123123 }
124124 }
125125
Index: trunk/phase3/maintenance/reassignEdits.php
@@ -67,7 +67,7 @@
6868 */
6969 private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
7070 $dbw = wfGetDB( DB_MASTER );
71 - $dbw->immediateBegin();
 71+ $dbw->begin();
7272
7373 # Count things
7474 $this->output( "Checking current edits..." );
@@ -113,7 +113,7 @@
114114 }
115115 }
116116
117 - $dbw->immediateCommit();
 117+ $dbw->commit();
118118 return (int)$total;
119119 }
120120
Index: trunk/phase3/maintenance/cleanupSpam.php
@@ -109,7 +109,7 @@
110110 $this->output( "False match\n" );
111111 } else {
112112 $dbw = wfGetDB( DB_MASTER );
113 - $dbw->immediateBegin();
 113+ $dbw->begin();
114114 if ( !$rev ) {
115115 // Didn't find a non-spammy revision, blank the page
116116 $this->output( "blanking\n" );
@@ -123,7 +123,7 @@
124124 $article = new Article( $title );
125125 $article->updateArticle( $rev->getText(), wfMsg( 'spam_reverting', $domain ), false, false );
126126 }
127 - $dbw->immediateCommit();
 127+ $dbw->commit();
128128 wfDoUpdates();
129129 }
130130 }
Index: trunk/phase3/maintenance/deleteOrphanedRevisions.php
@@ -39,7 +39,7 @@
4040 $report = $this->hasOption('report');
4141
4242 $dbw = wfGetDB( DB_MASTER );
43 - $dbw->immediateBegin();
 43+ $dbw->begin();
4444 list( $page, $revision ) = $dbw->tableNamesN( 'page', 'revision' );
4545
4646 # Find all the orphaned revisions
@@ -57,7 +57,7 @@
5858
5959 # Nothing to do?
6060 if( $report || $count == 0 ) {
61 - $dbw->immediateCommit();
 61+ $dbw->commit();
6262 exit(0);
6363 }
6464
@@ -67,7 +67,7 @@
6868 $this->output( "done.\n" );
6969
7070 # Close the transaction and call the script to purge unused text records
71 - $dbw->immediateCommit();
 71+ $dbw->commit();
7272 $this->purgeRedundantText( true );
7373 }
7474
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -843,22 +843,6 @@
844844 }
845845
846846 /**
847 - * Begin a transaction, committing any previously open transaction
848 - * @deprecated use begin()
849 - */
850 - function immediateBegin( $fname = 'Database::immediateBegin' ) {
851 - $this->begin();
852 - }
853 -
854 - /**
855 - * Commit transaction, if one is open
856 - * @deprecated use commit()
857 - */
858 - function immediateCommit( $fname = 'Database::immediateCommit' ) {
859 - $this->commit();
860 - }
861 -
862 - /**
863847 * Return MW-style timestamp used for MySQL schema
864848 */
865849 function timestamp( $ts=0 ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60051Update callers from immediateCommit() to commit(). The former's been deprecat...demon23:05, 14 December 2009

Status & tagging log