r55735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55734‎ | r55735 | r55736 >
Date:22:37, 1 September 2009
Author:aaron
Status:ok
Tags:
Comment:
May as well use the master for start/end points
Modified paths:
  • /trunk/phase3/maintenance/migrateUserGroup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/migrateUserGroup.php
@@ -35,10 +35,10 @@
3636 $count = 0;
3737 $oldGroup = $this->getArg( 0 );
3838 $newGroup = $this->getArg( 1 );
39 - $dbr = wfGetDB( DB_SLAVE );
40 - $start = $dbr->selectField( 'user_groups', 'MIN(ug_user)',
 39+ $dbw = wfGetDB( DB_MASTER );
 40+ $start = $dbw->selectField( 'user_groups', 'MIN(ug_user)',
4141 array('ug_group' => $oldGroup), __FUNCTION__ );
42 - $end = $dbr->selectField( 'user_groups', 'MAX(ug_user)',
 42+ $end = $dbw->selectField( 'user_groups', 'MAX(ug_user)',
4343 array('ug_group' => $oldGroup), __FUNCTION__ );
4444 if( $start === null ) {
4545 $this->error( "Nothing to do - no users in the '$oldGroup' group", true );
@@ -48,7 +48,6 @@
4949 $blockStart = $start;
5050 $blockEnd = $start + $this->mBatchSize - 1;
5151 // Migrate users over in batches...
52 - $dbw = wfGetDB( DB_MASTER );
5352 while( $blockEnd <= $end ) {
5453 $this->output( "Doing users $blockStart to $blockEnd\n" );
5554 $dbw->begin();

Status & tagging log