r25602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25601‎ | r25602 | r25603 >
Date:01:52, 7 September 2007
Author:simetrical
Status:old
Tags:
Comment:
Reinstate 25267 now that 1.11 is branched, and add the relatively long-requested rev_bot (with no index) while I'm at it. By the way, the current index-updating format in updaters.inc makes baby Jesus cry.
Modified paths:
  • /trunk/phase3/includes/Article.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
@@ -83,6 +83,7 @@
8484 array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'),
8585 array( 'archive', 'ar_page_id', 'patch-archive-page_id.sql'),
8686 array( 'image', 'img_sha1', 'patch-img_sha1.sql' ),
 87+ array( 'revision', 'rev_bot', 'patch-rev_bot.sql' ),
8788 );
8889
8990 # For extensions only, should be populated via hooks
@@ -1031,6 +1032,8 @@
10321033
10331034 do_oldimage_user_index(); flush ();
10341035
 1036+ do_revision_page_user_index(); flush ();
 1037+
10351038 echo "Deleting old default messages (this may take a long time!)..."; flush();
10361039 deleteDefaultMessages();
10371040 echo "Done\n"; flush();
@@ -1129,6 +1132,17 @@
11301133
11311134 }
11321135
 1136+function do_revision_page_user_index() {
 1137+ global $wgDatabase;
 1138+ if( $wgDatabase->indexExists( 'revision', 'page_user_timestamp' ) ) {
 1139+ echo "...page,user,timestamp key on revision already exists.\n";
 1140+ } else {
 1141+ echo "Adding page,user,timestamp key on revision table... ";
 1142+ dbsource( archive("patch-revision-user-page-index.sql"), $wgDatabase );
 1143+ echo "ok\n";
 1144+ }
 1145+}
 1146+
11331147 function
11341148 pg_describe_table($table)
11351149 {
Index: trunk/phase3/maintenance/tables.sql
@@ -270,6 +270,9 @@
271271 -- Not yet used; reserved for future changes to the deletion system.
272272 rev_deleted tinyint unsigned NOT NULL default '0',
273273
 274+ -- Was this edit made by a bot (and marked as such)?
 275+ rev_bot tinyint unsigned NOT NULL default '0',
 276+
274277 -- Length of this revision in bytes
275278 rev_len int unsigned,
276279
@@ -282,7 +285,8 @@
283286 INDEX rev_timestamp (rev_timestamp),
284287 INDEX page_timestamp (rev_page,rev_timestamp),
285288 INDEX user_timestamp (rev_user,rev_timestamp),
286 - INDEX usertext_timestamp (rev_user_text,rev_timestamp)
 289+ INDEX usertext_timestamp (rev_user_text,rev_timestamp),
 290+ INDEX page_user_timestamp (rev_page,rev_user,rev_timestamp)
287291
288292 ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
289293 -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit
Index: trunk/phase3/includes/Article.php
@@ -2463,8 +2463,8 @@
24642464 *
24652465 * @param Revision $rev
24662466 *
2467 - * @todo This is a shitty interface function. Kill it and replace the
2468 - * other shitty functions like editUpdates and such so it's not needed
 2467+ * @todo This is a lousy interface function. Kill it and replace the
 2468+ * other cruddy functions like editUpdates and such so it's not needed
24692469 * anymore.
24702470 */
24712471 function createUpdates( $rev ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r25607Merged revisions 25530-25606 via svnmerge from...david06:11, 7 September 2007

Status & tagging log