r5552 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5551‎ | r5552 | r5553 >
Date:19:49, 26 September 2004
Author:vibber
Status:old
Tags:
Comment:
Back out kturner's old table restructure for now.
This will require downtiime on upgrade, so we're not going to do it until we have a better idea of the cost and can make all necessary changes at once to minimize it.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/SpecialAsksql.php (modified) (history)
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -27,7 +27,6 @@
2828 array( 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
2929 array( 'user', 'user_real_name', 'patch-user-realname.sql' ),
3030 array( 'user', 'user_token', 'patch-user_token.sql' ),
31 - array( 'old', 'old_articleid', 'patch-remove-old-title-namespace.sql' ),
3231 );
3332
3433 function add_table( $name, $patch ) {
Index: trunk/phase3/maintenance/tables.sql
@@ -50,7 +50,7 @@
5151 cur_touched char(14) binary NOT NULL default '',
5252 inverse_timestamp char(14) binary NOT NULL default '',
5353 PRIMARY KEY cur_id (cur_id),
54 - INDEX name_title (cur_namespace,cur_title),
 54+ UNIQUE INDEX name_title (cur_namespace,cur_title),
5555
5656 -- Is this one necessary?
5757 INDEX cur_title (cur_title(20)),
@@ -65,7 +65,8 @@
6666
6767 CREATE TABLE old (
6868 old_id int(8) unsigned NOT NULL auto_increment,
69 - old_articleid int(8) unsigned NOT NULL,
 69+ old_namespace tinyint(2) unsigned NOT NULL default '0',
 70+ old_title varchar(255) binary NOT NULL default '',
7071 old_text mediumtext NOT NULL default '',
7172 old_comment tinyblob NOT NULL default '',
7273 old_user int(5) unsigned NOT NULL default '0',
@@ -76,9 +77,8 @@
7778 inverse_timestamp char(14) binary NOT NULL default '',
7879
7980 PRIMARY KEY old_id (old_id),
80 - INDEX articleid (old_articleid),
8181 INDEX old_timestamp (old_timestamp),
82 - INDEX articleid_timestamp (old_articleid,inverse_timestamp),
 82+ INDEX name_title_timestamp (old_namespace,old_title,inverse_timestamp),
8383 INDEX user_timestamp (old_user,inverse_timestamp),
8484 INDEX usertext_timestamp (old_user_text,inverse_timestamp)
8585 );
@@ -328,7 +328,7 @@
329329 -- Key to the page affected. Where a user is the target,
330330 -- this will point to the user page.
331331 log_namespace tinyint unsigned NOT NULL default 0,
332 - log_title varchar(255) binary NOT NULL default '',
 332+ log_title varchar(255) NOT NULL default '',
333333
334334 -- Freeform text. Interpreted as edit history comments.
335335 log_comment varchar(255) NOT NULL default '',
Index: trunk/phase3/includes/SpecialAsksql.php
@@ -154,9 +154,10 @@
155155 $r .= "<tr>";
156156 foreach ( $k as $x ) {
157157 $o = $y->$x ;
158 - if ( $x == "cur_title" or $x == "rc_title") {
 158+ if ( $x == "cur_title" or $x == "old_title" or $x == "rc_title") {
159159 $namespace = 0;
160160 if( $x == "cur_title" ) $namespace = $y->cur_namespace;
 161+ if( $x == "old_title" ) $namespace = $y->old_namespace;
161162 if( $x == "rc_title" ) $namespace = $y->rc_namespace;
162163 if( $namespace ) $o = $wgContLang->getNsText( $namespace ) . ":" . $o;
163164 $o = "<a href=\"" . wfLocalUrlE($o) . "\" class='internal'>" .
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -88,7 +88,7 @@
8989 global $wgUser, $wgOut, $wgLang, $wgDeferredUpdateList;
9090 global $wgUseSquid, $wgInternalServer, $wgLinkCache;
9191
92 - $fname = "undelete";
 92+ $fname = "doUndeleteArticle";
9393
9494 $dbw =& wfGetDB( DB_MASTER );
9595 extract( $dbw->tableNames( 'cur', 'archive', 'old' ) );
@@ -134,9 +134,9 @@
135135 # We should merge.
136136 }
137137
138 - $sql = "INSERT INTO $old (old_articleid,old_text," .
 138+ $sql = "INSERT INTO $old (old_namespace,old_title,old_text," .
139139 "old_comment,old_user,old_user_text,old_timestamp,inverse_timestamp,old_minor_edit," .
140 - "old_flags) SELECT ".$this->title->getArticleID().",ar_text,ar_comment," .
 140+ "old_flags) SELECT ar_namespace,ar_title,ar_text,ar_comment," .
141141 "ar_user,ar_user_text,ar_timestamp,99999999999999-ar_timestamp,ar_minor_edit,ar_flags " .
142142 "FROM $archive WHERE ar_namespace={$namespace} AND ar_title='{$t}' {$oldones}";
143143 $dbw->query( $sql, $fname );
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -27,7 +27,8 @@
2828 $this->mNewid = intval($old);
2929 $dbr =& wfGetDB( DB_SLAVE );
3030 $this->mOldid = $dbr->selectField( 'old', 'old_id',
31 - "old_articleid = " . $wgTitle->getArticleID() .
 31+ "old_title='" . $wgTitle->getDBkey() . "'" .
 32+ ' AND old_namespace=' . $wgTitle->getNamespace() .
3233 " AND old_id<{$this->mNewid} ORDER BY old_id DESC" );
3334
3435 } elseif ( 'next' == $new ) {
@@ -38,7 +39,8 @@
3940 $this->mOldid = intval($old);
4041 $dbr =& wfGetDB( DB_SLAVE );
4142 $this->mNewid = $dbr->selectField( 'old', 'old_id',
42 - "old_articleid = " . $wgTitle->getArticleID() .
 43+ "old_title='" . $wgTitle->getDBkey() . "'" .
 44+ ' AND old_namespace=' . $wgTitle->getNamespace() .
4345 " AND old_id>{$this->mOldid} ORDER BY old_id " );
4446 if ( false === $this->mNewid ) {
4547 # if no result, NewId points to the newest old revision. The only newer
@@ -271,7 +273,7 @@
272274 $this->mNewUser = $s->cur_user_text;
273275 $this->mNewComment = $s->cur_comment;
274276 } else {
275 - $s = $dbr->getArray( 'old', array( 'old_articleid', 'old_timestamp', 'old_text',
 277+ $s = $dbr->getArray( 'old', array( 'old_namespace','old_title','old_timestamp', 'old_text',
276278 'old_flags','old_user_text','old_comment' ), array( 'old_id' => $this->mNewid ), $fname );
277279
278280 if ( $s === false ) {
@@ -282,7 +284,7 @@
283285 $this->mNewtext = Article::getRevisionText( $s );
284286
285287 $t = $wgLang->timeanddate( $s->old_timestamp, true );
286 - $this->mNewPage = Title::newFromID( $s->old_articleid );
 288+ $this->mNewPage = Title::MakeTitle( $s->old_namespace, $s->old_title );
287289 $newLink = $wgTitle->getLocalUrl ('oldid=' . $this->mNewid);
288290 $this->mPagetitle = wfMsg( 'revisionasof', $t );
289291 $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>";
@@ -291,10 +293,11 @@
292294 }
293295 if ( 0 == $this->mOldid ) {
294296 $s = $dbr->getArray( 'old',
295 - array( 'old_timestamp','old_text', 'old_flags','old_user_text','old_comment' ),
 297+ array( 'old_namespace','old_title','old_timestamp','old_text', 'old_flags','old_user_text','old_comment' ),
296298 array( /* WHERE */
297 - 'old_articleid' => $this->mNewPage->getArticleID(),
298 - ), $fname, array( 'ORDER BY' => 'inverse_timestamp', 'USE INDEX' => 'articleid_timestamp' )
 299+ 'old_namespace' => $this->mNewPage->getNamespace(),
 300+ 'old_title' => $this->mNewPage->getDBkey()
 301+ ), $fname, array( 'ORDER BY' => 'inverse_timestamp', 'USE INDEX' => 'name_title_timestamp' )
299302 );
300303 if ( $s === false ) {
301304 wfDebug( 'Unable to load ' . $this->mNewPage->getPrefixedDBkey . " from old\n" );
@@ -302,7 +305,7 @@
303306 }
304307 } else {
305308 $s = $dbr->getArray( 'old',
306 - array( 'old_timestamp','old_text','old_flags','old_user_text','old_comment'),
 309+ array( 'old_namespace','old_title','old_timestamp','old_text','old_flags','old_user_text','old_comment'),
307310 array( 'old_id' => $this->mOldid ),
308311 $fname
309312 );
@@ -311,7 +314,7 @@
312315 return false;
313316 }
314317 }
315 - $this->mOldPage = Title::newFromID( $wgTitle->getArticleID() );
 318+ $this->mOldPage = Title::MakeTitle( $s->old_namespace, $s->old_title );
316319 $this->mOldtext = Article::getRevisionText( $s );
317320
318321 $t = $wgLang->timeanddate( $s->old_timestamp, true );
Index: trunk/phase3/includes/Title.php
@@ -49,11 +49,10 @@
5050 $this->mInterwiki = $this->mUrlform =
5151 $this->mTextform = $this->mDbkeyform = '';
5252 $this->mArticleID = -1;
53 - $this->mID = -1;
5453 $this->mNamespace = 0;
5554 $this->mRestrictionsLoaded = false;
5655 $this->mRestrictions = array();
57 - $this->mDefaultNamespace = 0;
 56+ $this->mDefaultNamespace = 0;
5857 }
5958
6059 # From a prefixed DB key
@@ -969,8 +968,8 @@
970969 $fname = 'Title::moveOverExistingRedirect';
971970 $comment = wfMsg( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
972971
973 - $now = wfTimestampNow();
974 - $won = wfInvertTimestamp( $now );
 972+ $now = wfTimestampNow();
 973+ $won = wfInvertTimestamp( $now );
975974 $newid = $nt->getArticleID();
976975 $oldid = $this->getArticleID();
977976 $dbw =& wfGetDB( DB_MASTER );
@@ -1015,6 +1014,21 @@
10161015
10171016 $wgLinkCache->clearLink( $this->getPrefixedDBkey() );
10181017
 1018+ # Fix the redundant names for the past revisions of the target page.
 1019+ # The redirect should have no old revisions.
 1020+ $dbw->updateArray(
 1021+ /* table */ 'old',
 1022+ /* SET */ array(
 1023+ 'old_namespace' => $nt->getNamespace(),
 1024+ 'old_title' => $nt->getDBkey(),
 1025+ ),
 1026+ /* WHERE */ array(
 1027+ 'old_namespace' => $this->getNamespace(),
 1028+ 'old_title' => $this->getDBkey(),
 1029+ ),
 1030+ $fname
 1031+ );
 1032+
10191033 RecentChange::notifyMoveOverRedirect( $now, $this, $nt, $wgUser, $comment );
10201034
10211035 # Swap links
@@ -1122,6 +1136,19 @@
11231137 $newid = $dbw->insertId();
11241138 $wgLinkCache->clearLink( $this->getPrefixedDBkey() );
11251139
 1140+ # Rename old entries
 1141+ $dbw->updateArray(
 1142+ /* table */ 'old',
 1143+ /* SET */ array(
 1144+ 'old_namespace' => $nt->getNamespace(),
 1145+ 'old_title' => $nt->getDBkey()
 1146+ ),
 1147+ /* WHERE */ array(
 1148+ 'old_namespace' => $this->getNamespace(),
 1149+ 'old_title' => $this->getDBkey()
 1150+ ), $fname
 1151+ );
 1152+
11261153 # Record in RC
11271154 RecentChange::notifyMoveToNew( $now, $this, $nt, $wgUser, $comment );
11281155
@@ -1181,7 +1208,8 @@
11821209 # Does the article have a history?
11831210 $row = $dbw->getArray( 'old', array( 'old_id' ),
11841211 array(
1185 - 'old_articleid' => $nt->getArticleID()
 1212+ 'old_namespace' => $nt->getNamespace(),
 1213+ 'old_title' => $nt->getDBkey()
11861214 ), $fname, 'FOR UPDATE'
11871215 );
11881216
@@ -1297,8 +1325,7 @@
12981326 }
12991327
13001328 function oldCond() {
1301 - #return array( 'old_namespace' => $this->mNamespace, 'old_title' => $this->mDbkeyform );
1302 - return array( 'old_articleid' => $this->getArticleID() );
 1329+ return array( 'old_namespace' => $this->mNamespace, 'old_title' => $this->mDbkeyform );
13031330 }
13041331 }
13051332 ?>
Index: trunk/phase3/includes/Article.php
@@ -382,7 +382,7 @@
383383 function &getOldContentFields() {
384384 global $wgArticleOldContentFields;
385385 if ( !$wgArticleOldContentFields ) {
386 - $wgArticleOldContentFields = array( 'old_articleid','old_text','old_timestamp',
 386+ $wgArticleOldContentFields = array( 'old_namespace','old_title','old_text','old_timestamp',
387387 'old_user','old_user_text','old_comment','old_flags' );
388388 }
389389 return $wgArticleOldContentFields;
@@ -475,8 +475,9 @@
476476 return;
477477 }
478478
479 - if( $this->mTitle->getArticleID() != $s->old_articleid ) {
480 - $oldTitle = Title::newFromID( $s->old_articleid );
 479+ if( $this->mTitle->getNamespace() != $s->old_namespace ||
 480+ $this->mTitle->getDBkey() != $s->old_title ) {
 481+ $oldTitle = Title::makeTitle( $s->old_namesapce, $s->old_title );
481482 $this->mTitle = $oldTitle;
482483 $wgTitle = $oldTitle;
483484 }
@@ -707,13 +708,14 @@
708709 $dbr =& $this->getDB();
709710 $oldTable = $dbr->tableName( 'old' );
710711 $userTable = $dbr->tableName( 'user' );
711 - $artid = $title->getArticleID();
 712+ $encDBkey = $dbr->addQuotes( $title->getDBkey() );
712713 $ns = $title->getNamespace();
713714 $user = $this->getUser();
714715
715716 $sql = "SELECT old_user, old_user_text, user_real_name, MAX(old_timestamp) as timestamp
716717 FROM $oldTable LEFT JOIN $userTable ON old_user = user_id
717 - WHERE old_articleid = $artid
 718+ WHERE old_namespace = $user
 719+ AND old_title = $encDBkey
718720 AND old_user != $user
719721 GROUP BY old_user, old_user_text, user_real_name
720722 ORDER BY timestamp DESC";
@@ -949,10 +951,9 @@
950952 $dbw =& wfGetDB( DB_MASTER );
951953 $ns = $this->mTitle->getNamespace();
952954 $title = $this->mTitle->getDBkey();
953 - $aid = $this->mTitle->getArticleID();
954955 $obj = $dbw->getArray( 'old',
955956 array( 'old_text','old_flags'),
956 - array( 'old_articleid' => $aid,
 957+ array( 'old_namespace' => $ns, 'old_title' => $title,
957958 'old_timestamp' => $dbw->timestamp($edittime)),
958959 $fname );
959960 $oldtext = Article::getRevisionText( $obj );
@@ -1111,7 +1112,8 @@
11121113 $dbw->insertArray( 'old',
11131114 array(
11141115 'old_id' => $dbw->nextSequenceValue( 'old_old_id_seq' ),
1115 - 'old_articleid' => $this->mTitle->getArticleID(),
 1116+ 'old_namespace' => $this->mTitle->getNamespace(),
 1117+ 'old_title' => $this->mTitle->getDBkey(),
11161118 'old_text' => $oldtext,
11171119 'old_comment' => $this->getComment(),
11181120 'old_user' => $this->getUser(),
@@ -1468,11 +1470,12 @@
14691471 $dbr =& $this->getDB();
14701472 $ns = $this->mTitle->getNamespace();
14711473 $title = $this->mTitle->getDBkey();
1472 - $artid = $this->mTitle->getArticleID();
14731474 $old = $dbr->getArray( 'old',
14741475 array( 'old_text', 'old_flags' ),
1475 - array( 'old_articleid' => $artid ),
1476 - $fname, $this->getSelectOptions( array( 'ORDER BY' => 'inverse_timestamp' ) )
 1476+ array(
 1477+ 'old_namespace' => $ns,
 1478+ 'old_title' => $title,
 1479+ ), $fname, $this->getSelectOptions( array( 'ORDER BY' => 'inverse_timestamp' ) )
14771480 );
14781481
14791482 if( $old !== false && !$confirm ) {
@@ -1668,7 +1671,6 @@
16691672 $recentchangesTable = $dbw->tableName( 'recentchanges' );
16701673 $linksTable = $dbw->tableName( 'links' );
16711674 $brokenlinksTable = $dbw->tableName( 'brokenlinks' );
1672 - $artid = $this->mTitle->getArticleID();
16731675
16741676 $dbw->insertSelect( 'archive', 'cur',
16751677 array(
@@ -1687,10 +1689,10 @@
16881690 ), $fname
16891691 );
16901692
1691 - $dbw->insertSelect( 'archive', 'cur,old',
 1693+ $dbw->insertSelect( 'archive', 'old',
16921694 array(
1693 - 'ar_namespace' => 'cur_namespace',
1694 - 'ar_title' => 'cur_title',
 1695+ 'ar_namespace' => 'old_namespace',
 1696+ 'ar_title' => 'old_title',
16951697 'ar_text' => 'old_text',
16961698 'ar_comment' => 'old_comment',
16971699 'ar_user' => 'old_user',
@@ -1699,14 +1701,15 @@
17001702 'ar_minor_edit' => 'old_minor_edit',
17011703 'ar_flags' => 'old_flags'
17021704 ), array(
1703 - 'old_articleid' => $artid
 1705+ 'old_namespace' => $ns,
 1706+ 'old_title' => $t,
17041707 ), $fname
17051708 );
17061709
17071710 # Now that it's safely backed up, delete it
17081711
17091712 $dbw->delete( 'cur', array( 'cur_namespace' => $ns, 'cur_title' => $t ), $fname );
1710 - $dbw->delete( 'old', array( 'old_articleid' => $artid ), $fname );
 1713+ $dbw->delete( 'old', array( 'old_namespace' => $ns, 'old_title' => $t ), $fname );
17111714 $dbw->delete( 'recentchanges', array( 'rc_namespace' => $ns, 'rc_title' => $t ), $fname );
17121715
17131716 # Finally, clean up the link tables
@@ -1798,9 +1801,10 @@
17991802 $s = $dbw->getArray( 'old',
18001803 array( 'old_text','old_user','old_user_text','old_timestamp','old_flags' ),
18011804 array(
1802 - 'old_articleid' => $pid,
 1805+ 'old_namespace' => $n,
 1806+ 'old_title' => $tt,
18031807 "old_user <> {$uid} OR old_user_text <> '{$ut}'"
1804 - ), $fname, array( 'FOR UPDATE', 'USE INDEX' => 'articleid_timestamp' )
 1808+ ), $fname, array( 'FOR UPDATE', 'USE INDEX' => 'name_title_timestamp' )
18051809 );
18061810 if( $s === false ) {
18071811 # Something wrong
@@ -2013,7 +2017,8 @@
20142018 # Save to history
20152019 $dbw->insertSelect( 'old', 'cur',
20162020 array(
2017 - 'old_articleid' => 'cur_id',
 2021+ 'old_namespace' => 'cur_namespace',
 2022+ 'old_title' => 'cur_title',
20182023 'old_text' => 'cur_text',
20192024 'old_comment' => 'cur_comment',
20202025 'old_user' => 'cur_user',
@@ -2167,7 +2172,7 @@
21682173
21692174 $basenamespace = $wgTitle->getNamespace() & (~1);
21702175 $cur_clause = array( 'cur_title' => $wgTitle->getDBkey(), 'cur_namespace' => $basenamespace );
2171 - $old_clause = array( 'old_articleid' => $wgTitle->getArticleID() );
 2176+ $old_clause = array( 'old_title' => $wgTitle->getDBkey(), 'old_namespace' => $basenamespace );
21722177 $wl_clause = array( 'wl_title' => $wgTitle->getDBkey(), 'wl_namespace' => $basenamespace );
21732178 $fullTitle = $wgTitle->makeName($basenamespace, $wgTitle->getDBKey());
21742179 $wgOut->setPagetitle( $fullTitle );
@@ -2200,15 +2205,13 @@
22012206
22022207 # now for the Talk page ...
22032208 $cur_clause = array( 'cur_title' => $wgTitle->getDBkey(), 'cur_namespace' => $basenamespace+1 );
 2209+ $old_clause = array( 'old_title' => $wgTitle->getDBkey(), 'old_namespace' => $basenamespace+1 );
22042210
22052211 # does it exist?
22062212 $exists = $dbr->selectField( 'cur', 'COUNT(*)', $cur_clause, $fname, $this->getSelectOptions() );
22072213
22082214 # number of edits
22092215 if ($exists > 0) {
2210 - $oldartid = $dbr->selectField( 'cur', 'cur_id',
2211 - $cur_clause, $fname, $this->getSelectOptions());
2212 - $old_clause = array( 'old_articleid' => $oldartid );
22132216 $old = $dbr->selectField( 'old', 'COUNT(*)', $old_clause, $fname, $this->getSelectOptions() );
22142217 $wgOut->addHTML( '<li>' . wfMsg("numtalkedits", $old + 1) . '</li>');
22152218 }
Index: trunk/phase3/includes/PageHistory.php
@@ -61,13 +61,14 @@
6262 $title = $this->mTitle->getText();
6363
6464 $db =& wfGetDB( DB_SLAVE );
65 - $use_index = $db->useIndexClause( 'articleid_timestamp' );
 65+ $use_index = $db->useIndexClause( 'name_title_timestamp' );
6666 $oldtable = $db->tableName( 'old' );
6767
6868 $sql = "SELECT old_id,old_user," .
6969 "old_comment,old_user_text,old_timestamp,old_minor_edit ".
7070 "FROM $oldtable $use_index " .
71 - "WHERE old_articleid='" . $db->strencode( $this->mTitle->getArticleID() ) . "' " .
 71+ "WHERE old_namespace={$namespace} AND " .
 72+ "old_title='" . $db->strencode( $this->mTitle->getDBkey() ) . "' " .
7273 "ORDER BY inverse_timestamp".$db->limitResult($limitplus,$rawoffset);
7374 $res = $db->query( $sql, $fname );
7475
Index: trunk/phase3/includes/SpecialContributions.php
@@ -86,7 +86,7 @@
8787 "ORDER BY inverse_timestamp LIMIT {$querylimit}";
8888 $res1 = $dbr->query( $sql, $fname );
8989
90 - $sql = "SELECT old_articleid,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
 90+ $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
9191 "WHERE old_user_text='" . $dbr->strencode( $nt->getText() ) . "' {$omq} " .
9292 "ORDER BY inverse_timestamp LIMIT {$querylimit}";
9393 $res2 = $dbr->query( $sql, $fname );
@@ -95,7 +95,7 @@
9696 "WHERE cur_user {$userCond} {$cmq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
9797 $res1 = $dbr->query( $sql, $fname );
9898
99 - $sql = "SELECT old_articleid,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
 99+ $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
100100 "WHERE old_user {$userCond} {$omq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
101101 $res2 = $dbr->query( $sql, $fname );
102102 }
@@ -141,9 +141,8 @@
142142 $oldid = false;
143143 --$nCur;
144144 } else {
145 - $tt = Title::newFromID($obj2->old_articleid);
146 - $ns = $tt->getNamespace();
147 - $t = $tt->getDBkey();
 145+ $ns = $obj2->old_namespace;
 146+ $t = $obj2->old_title;
148147 $ts = $obj2->old_timestamp;
149148 $comment =$obj2->old_comment;
150149 $me = $obj2->old_minor_edit;
Index: trunk/phase3/includes/EditPage.php
@@ -621,7 +621,7 @@
622622 $title = $this->mTitle->getDBkey();
623623 $obj = $dbw->getArray( 'old',
624624 array( 'old_text','old_flags'),
625 - array( 'old_articleid' => $this->mTitle->getArticleID(),
 625+ array( 'old_namespace' => $ns, 'old_title' => $title,
626626 'old_timestamp' => $dbw->timestamp($oldDate)),
627627 $fname );
628628 $oldText = Article::getRevisionText( $obj );

Status & tagging log