r7515 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7514‎ | r7515 | r7516 >
Date:15:33, 21 February 2005
Author:midom
Status:old
Tags:
Comment:
remove inverse_timestamp wherever it is found and disable wfInvertTimestamp()
dear mysql3, try to remember how beautiful filesorts are, you're so good at it.
Modified paths:
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Image.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/SpecialImport.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/InitialiseMessages.inc (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-restructure.sql (modified) (history)
  • /trunk/phase3/maintenance/importPhase2.php (modified) (history)
  • /trunk/phase3/maintenance/importUseModWiki.php (modified) (history)
  • /trunk/phase3/maintenance/postgresql/pg_tables.sql (modified) (history)
  • /trunk/phase3/maintenance/rebuildrecentchanges.inc (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/postgresql/pg_tables.sql
@@ -21,8 +21,7 @@
2222 cur_minor_edit smallint DEFAULT 0 NOT NULL,
2323 cur_is_new smallint DEFAULT 0 NOT NULL,
2424 cur_random double precision DEFAULT random(),
25 - cur_touched timestamp without time zone,
26 - inverse_timestamp varchar(14)
 25+ cur_touched timestamp without time zone
2726 );
2827 CREATE INDEX cur_title_namespace_idx ON cur (cur_title, cur_namespace);
2928 CREATE INDEX cur_random_idx ON cur (cur_random);
@@ -39,8 +38,7 @@
4039 old_user_text varchar(255) NOT NULL,
4140 old_timestamp timestamp without time zone NOT NULL,
4241 old_minor_edit smallint NOT NULL,
43 - old_flags text NOT NULL,
44 - inverse_timestamp varchar(14) NOT NULL
 42+ old_flags text NOT NULL
4543 );
4644 CREATE INDEX old_name_title_ts_idx ON "old" (old_namespace, old_title, old_timestamp);
4745 CREATE INDEX old_timestamp ON "old" (old_timestamp);
Index: trunk/phase3/maintenance/importPhase2.php
@@ -109,10 +109,10 @@
110110 print "Importing current revision data...\n";
111111 wfQuery( "INSERT INTO cur (cur_id,cur_namespace,cur_title,cur_text,cur_comment,
112112 cur_user,cur_user_text,cur_timestamp,cur_restrictions,cur_counter,
113 - cur_is_redirect,cur_minor_edit,cur_is_new,cur_random,cur_touched,inverse_timestamp)
 113+ cur_is_redirect,cur_minor_edit,cur_is_new,cur_random,cur_touched)
114114 SELECT cur_id,0,cur_title,cur_text,cur_comment,
115115 cur_user,cur_user_text,cur_timestamp,REPLACE(cur_restrictions,'is_',''),cur_counter,
116 - cur_text like '#redirect%',cur_minor_edit,0,RAND(),NOW()+0,99999999999999-cur_timestamp
 116+ cur_text like '#redirect%',cur_minor_edit,0,RAND(),NOW()+0,
117117 FROM {$this->olddb}.cur", DB_MASTER );
118118 $n = mysql_affected_rows();
119119 print "$n rows imported.\n";
@@ -124,9 +124,9 @@
125125
126126 print "Importing old revision data...\n";
127127 wfQuery( "INSERT INTO old (old_id,old_namespace,old_title,old_text,old_comment,
128 - old_user,old_user_text,old_timestamp,old_minor_edit,old_flags,inverse_timestamp)
 128+ old_user,old_user_text,old_timestamp,old_minor_edit,old_flags)
129129 SELECT old_id,0,old_title,old_text,old_comment,
130 - old_user,old_user_text,old_timestamp,old_minor_edit,'',99999999999999-old_timestamp
 130+ old_user,old_user_text,old_timestamp,old_minor_edit,''
131131 FROM {$this->olddb}.old", DB_MASTER );
132132 $n = mysql_affected_rows();
133133 print "$n rows imported.\n";
Index: trunk/phase3/maintenance/archives/patch-restructure.sql
@@ -34,14 +34,13 @@
3535 rev_user_text varchar(255) binary NOT NULL default '',
3636 rev_timestamp char(14) binary NOT NULL default '',
3737 rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
38 - inverse_timestamp char(14) binary NOT NULL default '',
3938
4039 PRIMARY KEY rev_page_id (rev_page, rev_id),
4140 UNIQUE INDEX rev_id (rev_id),
4241 INDEX rev_timestamp (rev_timestamp),
43 - INDEX page_timestamp (rev_page,inverse_timestamp),
44 - INDEX user_timestamp (rev_user,inverse_timestamp),
45 - INDEX usertext_timestamp (rev_user_text,inverse_timestamp)
 42+ INDEX page_timestamp (rev_page,rev_timestamp),
 43+ INDEX user_timestamp (rev_user,rev_timestamp),
 44+ INDEX usertext_timestamp (rev_user_text,rev_timestamp)
4645 );
4746
4847 -- If creating new 'text' table it would look like this:
@@ -72,8 +71,7 @@
7372 old_user_text,
7473 old_timestamp,
7574 old_minor_edit,
76 - old_flags,
77 - inverse_timestamp)
 75+ old_flags)
7876 SELECT
7977 cur_namespace,
8078 cur_title,
@@ -83,8 +81,7 @@
8482 cur_user_text,
8583 cur_timestamp,
8684 cur_minor_edit,
87 - '',
88 - inverse_timestamp
 85+ ''
8986 FROM /*$wgDBprefix*/cur;
9087
9188 -- Now, copy all old data except the text into revisions
@@ -96,7 +93,6 @@
9794 rev_user,
9895 rev_user_text,
9996 rev_timestamp,
100 - inverse_timestamp,
10197 rev_minor_edit)
10298 SELECT
10399 old_id,
@@ -105,7 +101,6 @@
106102 old_user,
107103 old_user_text,
108104 old_timestamp,
109 - old.inverse_timestamp,
110105 old_minor_edit
111106 FROM /*$wgDBprefix*/old,/*$wgDBprefix*/cur
112107 WHERE old_namespace=cur_namespace
Index: trunk/phase3/maintenance/rebuildrecentchanges.inc
@@ -34,7 +34,7 @@
3535 'rc_this_oldid' => 0,
3636 'rc_last_oldid' => 0,
3737 'rc_type' => $dbw->conditional( 'cur_is_new != 0', RC_NEW, RC_EDIT ),
38 - ), '*', $fname, array( 'ORDER BY' => 'inverse_timestamp', 'LIMIT' => 5000 )
 38+ ), '*', $fname, array( 'ORDER BY' => 'cur_timestamp DESC', 'LIMIT' => 5000 )
3939 );
4040
4141 print( "Loading from OLD table...\n" );
@@ -44,7 +44,7 @@
4545 "rc_cur_id,rc_this_oldid,rc_last_oldid,rc_type) SELECT old_timestamp,cur_timestamp," .
4646 "old_user,old_user_text,old_namespace,old_title,old_comment," .
4747 "old_minor_edit,0,0,cur_id,old_id,0,0 FROM $old,$cur " .
48 - "WHERE old_namespace=cur_namespace AND old_title=cur_title ORDER BY $old.inverse_timestamp " .
 48+ "WHERE old_namespace=cur_namespace AND old_title=cur_title ORDER BY old_timestamp DESC " .
4949 "LIMIT 5000";
5050 $dbw->query( $sql );
5151
@@ -83,10 +83,10 @@
8484 if( $obj->rc_cur_id != $lastCurId ) {
8585 # Switch! Look up the previous last edit, if any
8686 $lastCurId = IntVal( $obj->rc_cur_id );
87 - $emit = wfInvertTimestamp( $obj->rc_timestamp );
 87+ $emit = $obj->rc_timestamp;
8888 $sql2 = "SELECT old_id FROM $old,$cur " .
8989 "WHERE old_namespace=cur_namespace AND old_title=cur_title AND cur_id={$lastCurId} ".
90 - "AND $old.inverse_timestamp>'{$emit}' ORDER BY $old.inverse_timestamp LIMIT 1";
 90+ "AND old_timestamp<'{$emit}' ORDER BY old_timestamp DESC LIMIT 1";
9191 $res2 = $dbw->query( $sql2 );
9292 if( $row = $dbw->fetchObject( $res2 ) ) {
9393 $lastOldId = IntVal( $row->old_id );
Index: trunk/phase3/maintenance/InitialiseMessages.inc
@@ -197,8 +197,8 @@
198198 $page_id = $dbw->insertID();
199199
200200 $sql = "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text,
201 - rev_timestamp, inverse_timestamp, rev_minor_edit)
202 - VALUES ({$text_id}, {$page_id}, '', 0, '{$username}', '{$timestamp}', '{$invTimestamp}', 0)";
 201+ rev_timestamp, rev_minor_edit)
 202+ VALUES ({$text_id}, {$page_id}, '', 0, '{$username}', '{$timestamp}', 0)";
203203 $dbw->query( $sql, $fname );
204204
205205 }
@@ -225,4 +225,4 @@
226226 global $wgDeferredUpdateList;
227227 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }
228228 }
229 -?>
\ No newline at end of file
 229+?>
Index: trunk/phase3/maintenance/updaters.inc
@@ -359,14 +359,13 @@
360360 rev_user_text varchar(255) binary NOT NULL default '',
361361 rev_timestamp char(14) binary NOT NULL default '',
362362 rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
363 - inverse_timestamp char(14) binary NOT NULL default '',
364363
365364 PRIMARY KEY rev_page_id (rev_page, rev_id),
366365 UNIQUE INDEX rev_id (rev_id),
367366 INDEX rev_timestamp (rev_timestamp),
368 - INDEX page_timestamp (rev_page,inverse_timestamp),
369 - INDEX user_timestamp (rev_user,inverse_timestamp),
370 - INDEX usertext_timestamp (rev_user_text,inverse_timestamp)
 367+ INDEX page_timestamp (rev_page,rev_timestamp),
 368+ INDEX user_timestamp (rev_user,rev_timestamp),
 369+ INDEX usertext_timestamp (rev_user_text,rev_timestamp)
371370 )", $fname );
372371
373372 echo "......Locking tables.\n";
@@ -377,16 +376,15 @@
378377
379378 echo "......Moving text from cur.\n";
380379 $wgDatabase->query( "INSERT INTO $old (old_namespace, old_title, old_text, old_comment, old_user, old_user_text,
381 - old_timestamp, old_minor_edit, old_flags, inverse_timestamp)
382 - SELECT cur_namespace, cur_title, cur_text, cur_comment, cur_user, cur_user_text, cur_timestamp, cur_minor_edit,
383 - '', inverse_timestamp
 380+ old_timestamp, old_minor_edit, old_flags, rev_timestamp)
 381+ SELECT cur_namespace, cur_title, cur_text, cur_comment, cur_user, cur_user_text, cur_timestamp, cur_minor_edit,''
384382 FROM $cur", $fname );
385383
386384 echo "......Setting up revision table.\n";
387385 $wgDatabase->query( "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text, rev_timestamp,
388 - inverse_timestamp, rev_minor_edit)
 386+ rev_minor_edit)
389387 SELECT old_id, cur_id, old_comment, old_user, old_user_text,
390 - old_timestamp, $old.inverse_timestamp, old_minor_edit
 388+ old_timestamp, old_minor_edit
391389 FROM $old,$cur WHERE old_namespace=cur_namespace AND old_title=cur_title", $fname );
392390
393391 echo "......Setting up page table.\n";
Index: trunk/phase3/maintenance/importUseModWiki.php
@@ -243,7 +243,6 @@
244244 $timestamp = wfUnix2Timestamp( time() );
245245 $redirect = ( preg_match( '/^#REDIRECT/', $page->text ) ? 1 : 0 );
246246 $random = mt_rand() / mt_getrandmax();
247 - $inverse = wfInvertTimestamp( $timestamp );
248247
249248 $revisions = array( $page );
250249 } else {
@@ -258,14 +257,13 @@
259258 $timestamp = wfUnix2Timestamp( $page->ts );
260259 $redirect = ( preg_match( '/^#REDIRECT/', $page->text ) ? 1 : 0 );
261260 $random = mt_rand() / mt_getrandmax();
262 - $inverse = wfInvertTimestamp( $timestamp );
263261
264262 $revisions = array();
265263 }
266264 $sql = "
267265 INSERT
268 - INTO cur (cur_namespace,cur_title,cur_text,cur_comment,cur_user,cur_user_text,cur_timestamp,inverse_timestamp,cur_touched,cur_minor_edit,cur_is_redirect,cur_random) VALUES
269 - ($namespace,'$newtitle','$text','$comment',$userid,'$username','$timestamp','$inverse','$conversiontime',$minor,$redirect,$random);\n";
 266+ INTO cur (cur_namespace,cur_title,cur_text,cur_comment,cur_user,cur_user_text,cur_timestamp,cur_touched,cur_minor_edit,cur_is_redirect,cur_random) VALUES
 267+ ($namespace,'$newtitle','$text','$comment',$userid,'$username','$timestamp','$conversiontime',$minor,$redirect,$random);\n";
270268
271269 # History
272270 $revisions = array_merge( $revisions, fetchKeptPages( $title ) );
@@ -275,18 +273,17 @@
276274
277275 $any = false;
278276 $sql .= "INSERT
279 - INTO old (old_namespace,old_title,old_text,old_comment,old_user,old_user_text,old_timestamp,inverse_timestamp,old_minor_edit) VALUES\n";
 277+ INTO old (old_namespace,old_title,old_text,old_comment,old_user,old_user_text,old_timestamp,old_minor_edit) VALUES\n";
280278 foreach( $revisions as $rev ) {
281279 $text = wfStrencode( recodeText( $rev->text ) );
282280 $minor = ($rev->minor ? 1 : 0);
283281 list( $userid, $username ) = checkUserCache( $rev->username, $rev->host );
284282 $username = wfStrencode( recodeText( $username ) );
285283 $timestamp = wfUnix2Timestamp( $rev->ts );
286 - $inverse = wfInvertTimestamp( $timestamp );
287284 $comment = wfStrencode( recodeText( $rev->summary ) );
288285
289286 if($any) $sql .= ",";
290 - $sql .= "\n\t($namespace,'$newtitle','$text','$comment',$userid,'$username','$timestamp','$inverse',$minor)";
 287+ $sql .= "\n\t($namespace,'$newtitle','$text','$comment',$userid,'$username','$timestamp',$minor)";
291288 $any = true;
292289 }
293290 $sql .= ";\n\n";
Index: trunk/phase3/maintenance/tables.sql
@@ -60,14 +60,13 @@
6161 rev_user_text varchar(255) binary NOT NULL default '',
6262 rev_timestamp char(14) binary NOT NULL default '',
6363 rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
64 - inverse_timestamp char(14) binary NOT NULL default '',
6564
6665 PRIMARY KEY rev_page_id (rev_page, rev_id),
6766 UNIQUE INDEX rev_id (rev_id),
6867 INDEX rev_timestamp (rev_timestamp),
69 - INDEX page_timestamp (rev_page,inverse_timestamp),
70 - INDEX user_timestamp (rev_user,inverse_timestamp),
71 - INDEX usertext_timestamp (rev_user_text,inverse_timestamp)
 68+ INDEX page_timestamp (rev_page,rev_timestamp),
 69+ INDEX user_timestamp (rev_user,rev_timestamp),
 70+ INDEX usertext_timestamp (rev_user_text,rev_timestamp)
7271 );
7372
7473
Index: trunk/phase3/config/index.php
@@ -583,8 +583,8 @@
584584 $page_id = $wgDatabase->insertID();
585585
586586 $sql = "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text,
587 - rev_timestamp, inverse_timestamp, rev_minor_edit)
588 - VALUES ({$text_id}, {$page_id}, '', 0, 'MediaWiki default', '{$now}', '{$won}', 0)";
 587+ rev_timestamp, rev_minor_edit)
 588+ VALUES ({$text_id}, {$page_id}, '', 0, 'MediaWiki default', '{$now}', 0)";
589589 $wgDatabase->query( $sql, $fname );
590590
591591 print "<li><pre>";
Index: trunk/phase3/includes/SpecialRecentchangeslinked.php
@@ -74,13 +74,13 @@
7575 "rev_user_text,rev_timestamp,rev_minor_edit,page_is_new FROM $categorylinks, $revision, $page " .
7676 "WHERE rev_timestamp > '{$cutoff}' {$cmq} AND cl_from=page_id AND cl_to=$catkey " .
7777 "GROUP BY page_id,page_namespace,page_title,rev_user,rev_comment,rev_user_text," .
78 - "rev_timestamp,rev_minor_edit,page_is_new,inverse_timestamp ORDER BY inverse_timestamp LIMIT {$limit}";
 78+ "rev_timestamp,rev_minor_edit,page_is_new ORDER BY rev_timestamp DESC LIMIT {$limit}";
7979 } else {
8080 $sql = "SELECT page_id,page_namespace,page_title,rev_user,rev_comment," .
8181 "rev_user_text,rev_timestamp,rev_minor_edit,page_is_new FROM $links, $revision, $page " .
8282 "WHERE rev_timestamp > '{$cutoff}' {$cmq} AND l_to=page_id AND l_from=$id " .
8383 "GROUP BY page_id,page_namespace,page_title,rev_user,rev_comment,rev_user_text," .
84 - "rev_timestamp,rev_minor_edit,page_is_new,inverse_timestamp ORDER BY inverse_timestamp LIMIT {$limit}";
 84+ "rev_timestamp,rev_minor_edit,page_is_new ORDER BY rev_timestamp DESC LIMIT {$limit}";
8585 }
8686 $res = $dbr->query( $sql, $fname );
8787
Index: trunk/phase3/includes/SpecialImport.php
@@ -503,7 +503,6 @@
504504 'old_user' => intval( $user->getId() ),
505505 'old_user_text' => $user->getName(),
506506 'old_timestamp' => $this->timestamp,
507 - 'inverse_timestamp' => wfInvertTimestamp( $this->timestamp ),
508507 'old_minor_edit' => 0,
509508 'old_flags' => ''
510509 ), $fname
Index: trunk/phase3/includes/Article.php
@@ -718,7 +718,6 @@
719719 else { $redir = 0; }
720720
721721 $now = wfTimestampNow();
722 - $won = wfInvertTimestamp( $now );
723722 wfSeedRandom();
724723 $rand = wfRandom();
725724 $isminor = ( $isminor && $wgUser->isLoggedIn() ) ? 1 : 0;
@@ -759,7 +758,6 @@
760759 'rev_timestamp' => $dbw->timestamp($now),
761760 'rev_minor_edit' => $isminor,
762761 'rev_user_text' => $wgUser->getName(),
763 - 'inverse_timestamp' => $won,
764762 ), $fname );
765763
766764 $this->mTitle->resetArticleID( $newid );
@@ -948,7 +946,6 @@
949947 $this->mCountAdjustment = $this->isCountable( $text )
950948 - $this->isCountable( $oldtext );
951949 $now = wfTimestampNow();
952 - $won = wfInvertTimestamp( $now );
953950
954951 $mungedText = $text;
955952 $flags = Revision::compressRevisionText( $mungedText );
@@ -977,7 +974,6 @@
978975 'rev_user' => $wgUser->getID(),
979976 'rev_user_text' => $wgUser->getName(),
980977 'rev_timestamp' => $dbw->timestamp( $now ),
981 - 'inverse_timestamp' => $won
982978 ), $fname
983979 );
984980
@@ -1401,7 +1397,7 @@
14021398 'page_namespace' => $ns,
14031399 'page_title' => $title,
14041400 'rev_page = page_id'
1405 - ), $fname, $this->getSelectOptions( array( 'ORDER BY' => 'inverse_timestamp' ) )
 1401+ ), $fname, $this->getSelectOptions( array( 'ORDER BY' => 'rev_timestamp DESC' ) )
14061402 );
14071403
14081404 if( $dbr->numRows( $revisions ) > 1 && !$confirm ) {
@@ -1975,7 +1971,6 @@
19761972 'rev_user' => $wgUser->getID(),
19771973 'rev_user_text' => $wgUser->getName(),
19781974 'rev_timestamp' => $timestamp,
1979 - 'inverse_timestamp' => wfInvertTimestamp( $timestamp ),
19801975 'rev_minor_edit' => intval($minor) ),
19811976 $fname );
19821977 wfProfileOut( $fname );
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -962,8 +962,10 @@
963963
964964 /**
965965 * Sorting hack for MySQL 3, which doesn't use index sorts for DESC
 966+ * No longer supported and nuked.
966967 */
967968 function wfInvertTimestamp( $ts ) {
 969+ wfDieDebugBacktrace("Inverted timestamps should be nuked away from all code\n");
968970 return strtr(
969971 $ts,
970972 '0123456789',
Index: trunk/phase3/includes/SpecialContributions.php
@@ -104,7 +104,7 @@
105105 rev_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user_text
106106 FROM $page,$revision $use_index
107107 WHERE page_id=rev_page AND $condition $minorQuery " .
108 - "ORDER BY inverse_timestamp LIMIT {$querylimit}";
 108+ "ORDER BY rev_timestamp DESC LIMIT {$querylimit}";
109109 $res = $dbr->query( $sql, $fname );
110110 $numRows = $dbr->numRows( $res );
111111
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -184,7 +184,6 @@
185185 'cur_is_redirect' => $redir,
186186 'cur_random' => $rand,
187187 'cur_touched' => $dbw->timestamp( $now ),
188 - 'inverse_timestamp' => wfInvertTimestamp( wfTimestamp( TS_MW, $s->ar_timestamp ) ),
189188 ), $fname );
190189
191190 $newid = $dbw->insertId();
@@ -213,9 +212,9 @@
214213 $oldones = "AND ar_timestamp IN ( {$oldts} )";
215214 }
216215 $sql = "INSERT INTO $old (old_namespace,old_title,old_text," .
217 - "old_comment,old_user,old_user_text,old_timestamp,inverse_timestamp,old_minor_edit," .
 216+ "old_comment,old_user,old_user_text,old_timestamp,old_minor_edit," .
218217 "old_flags) SELECT ar_namespace,ar_title,ar_text,ar_comment," .
219 - "ar_user,ar_user_text,ar_timestamp,99999999999999-ar_timestamp,ar_minor_edit,ar_flags " .
 218+ "ar_user,ar_user_text,ar_timestamp,ar_minor_edit,ar_flags " .
220219 "FROM $archive WHERE ar_namespace={$namespace} AND ar_title='{$t}' {$oldones}";
221220 if( $restoreAll || !empty( $oldts ) ) {
222221 $dbw->query( $sql, $fname );
Index: trunk/phase3/includes/Title.php
@@ -1442,7 +1442,6 @@
14431443 $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
14441444
14451445 $now = wfTimestampNow();
1446 - $won = wfInvertTimestamp( $now );
14471446 $rand = wfRandom();
14481447 $newid = $nt->getArticleID();
14491448 $oldid = $this->getArticleID();
@@ -1474,8 +1473,8 @@
14751474 'rev_comment' => $comment,
14761475 'rev_user' => $wgUser->getID(),
14771476 'rev_user_text' => $wgUser->getName(),
1478 - 'rev_timestamp' => $now,
1479 - 'inverse_timestamp' => $won ), $fname
 1477+ 'rev_timestamp' => $now
 1478+ ), $fname
14801479 );
14811480 $revid = $dbw->insertId();
14821481 $dbw->insert( 'text', array(
@@ -1578,7 +1577,6 @@
15791578 $oldid = $this->getArticleID();
15801579 $dbw =& wfGetDB( DB_MASTER );
15811580 $now = $dbw->timestamp();
1582 - $won = wfInvertTimestamp( wfTimestamp(TS_MW,$now) );
15831581 wfSeedRandom();
15841582 $rand = wfRandom();
15851583
@@ -1602,8 +1600,8 @@
16031601 'rev_comment' => $comment,
16041602 'rev_user' => $wgUser->getID(),
16051603 'rev_user_text' => $wgUser->getName(),
1606 - 'rev_timestamp' => $now,
1607 - 'inverse_timestamp' => $won ), $fname
 1604+ 'rev_timestamp' => $now
 1605+ ), $fname
16081606 );
16091607 $revid = $dbw->insertId();
16101608 $dbw->insert( 'text', array(
@@ -1728,7 +1726,6 @@
17291727 $fname = 'Title::createRedirect';
17301728 $dbw =& wfGetDB( DB_MASTER );
17311729 $now = wfTimestampNow();
1732 - $won = wfInvertTimestamp( $now );
17331730
17341731 $seqVal = $dbw->nextSequenceValue( 'page_page_id_seq' );
17351732 $dbw->insert( 'page', array(
@@ -1757,7 +1754,6 @@
17581755 'rev_user' => $wgUser->getID(),
17591756 'rev_user_text' => $wgUser->getName(),
17601757 'rev_timestamp' => $now,
1761 - 'inverse_timestamp' => $won,
17621758 ), $fname );
17631759
17641760 $dbw->update( 'page',
@@ -1913,4 +1909,4 @@
19141910 }
19151911
19161912 }
1917 -?>
\ No newline at end of file
 1913+?>
Index: trunk/phase3/includes/Image.php
@@ -701,7 +701,6 @@
702702
703703
704704 $now = wfTimestampNow();
705 - $won = wfInvertTimestamp( $now );
706705 $size = IntVal( $size );
707706
708707 if ( $wgUseCopyrightUpload ) {
@@ -712,7 +711,6 @@
713712 else $textdesc = $desc ;
714713
715714 $now = wfTimestampNow();
716 - $won = wfInvertTimestamp( $now );
717715
718716 # Test to see if the row exists using INSERT IGNORE
719717 # This avoids race conditions by locking the row until the commit, and also
Index: trunk/phase3/includes/PageHistory.php
@@ -69,7 +69,7 @@
7070 "rev_comment,rev_user_text,rev_timestamp,rev_minor_edit ".
7171 "FROM $revision $use_index " .
7272 "WHERE rev_page=$id " .
73 - "ORDER BY inverse_timestamp ".$db->limitResult($limitplus,$offset);
 73+ "ORDER BY rev_timestamp DESC ".$db->limitResult($limitplus,$offset);
7474 $res = $db->query( $sql, $fname );
7575
7676 $revs = $db->numRows( $res );

Status & tagging log