r39598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39597‎ | r39598 | r39599 >
Date:18:09, 18 August 2008
Author:aaron
Status:old
Tags:
Comment:
Check $uid in query as well
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -376,23 +376,23 @@
377377 $this->uid = $uid;
378378
379379 $this->tables = array(); // Immediate updates
380 - $this->tables['image'] = 'img_user_text';
381 - $this->tables['oldimage'] = 'oi_user_text';
382 - # FIXME: $this->tables['filearchive'] = 'fa_user_text'; (not indexed yet)
 380+ $this->tables['image'] = array('img_user_text','img_user');
 381+ $this->tables['oldimage'] = array('oi_user_text','oi_user');
 382+ # FIXME: $this->tables['filearchive'] = array('fa_user_text','fa_user'); (not indexed yet)
383383 $this->tablesJob = array(); // Slow updates
384384 // If this user has a large number of edits, use the jobqueue
385385 if( User::edits($this->uid) > RENAMEUSER_CONTRIBJOB ) {
386386 $this->tablesJob['revision'] = array('rev_user_text','rev_user','rev_timestamp');
387387 $this->tablesJob['archive'] = array('ar_user_text','ar_user','ar_timestamp');
388388 } else {
389 - $this->tables['revision'] = 'rev_user_text';
390 - $this->tables['archive'] = 'ar_user_text';
 389+ $this->tables['revision'] = array('rev_user_text','rev_user');
 390+ $this->tables['archive'] = array('ar_user_text','ar_user');
391391 }
392392 // Recent changes is pretty hot, deadlocks occur if done all at once
393393 if( wfQueriesMustScale() ) {
394394 $this->tablesJob['recentchanges'] = array('rc_user_text','rc_user','rc_timestamp');
395395 } else {
396 - $this->tables['recentchanges'] = 'rc_user_text';
 396+ $this->tables['recentchanges'] = array('rc_user_text','rc_user');
397397 }
398398 }
399399
@@ -432,10 +432,11 @@
433433 'log_title' => $oldTitle->getDBKey() ),
434434 __METHOD__ );
435435 // Do immediate updates!
436 - foreach( $this->tables as $table => $field ) {
 436+ foreach( $this->tables as $table => $fieldSet ) {
 437+ list($nameCol,$userCol) = $fieldSet;
437438 $dbw->update( $table,
438 - array( $field => $this->new ),
439 - array( $field => $this->old ),
 439+ array( $nameCol => $this->new ),
 440+ array( $nameCol => $this->old, $userCol => $this->uid ),
440441 __METHOD__
441442 );
442443 }

Status & tagging log