* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
* (bug 40352) fixDoubleRedirects.php should support interwiki redirects.
* (bug 9237) SpecialBrokenRedirect should not list interwiki redirects.
+* (bug 34960) Drop unused fields rc_moved_to_ns and rc_moved_to_title from recentchanges table.
=== API changes in 1.21 ===
* (bug 35693) ApiQueryImageInfo now suppresses errors when unserializing metadata.
return $this->mTitle;
}
- /**
- * @return bool|Title
- */
- public function getMovedToTitle() {
- if( $this->mMovedToTitle === false ) {
- $this->mMovedToTitle = Title::makeTitle( $this->mAttribs['rc_moved_to_ns'],
- $this->mAttribs['rc_moved_to_title'] );
- }
- return $this->mMovedToTitle;
- }
-
/**
* Get the User object of the person who performed this change.
*
'rc_this_oldid' => $newId,
'rc_last_oldid' => $oldId,
'rc_bot' => $bot ? 1 : 0,
- 'rc_moved_to_ns' => 0,
- 'rc_moved_to_title' => '',
'rc_ip' => self::checkIPAddress( $ip ),
'rc_patrolled' => intval($patrol),
'rc_new' => 0, # obsolete
'rc_this_oldid' => $newId,
'rc_last_oldid' => 0,
'rc_bot' => $bot ? 1 : 0,
- 'rc_moved_to_ns' => 0,
- 'rc_moved_to_title' => '',
'rc_ip' => self::checkIPAddress( $ip ),
'rc_patrolled' => intval($patrol),
'rc_new' => 1, # obsolete
'rc_this_oldid' => 0,
'rc_last_oldid' => 0,
'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot', true ) : 0,
- 'rc_moved_to_ns' => 0,
- 'rc_moved_to_title' => '',
'rc_ip' => self::checkIPAddress( $ip ),
'rc_patrolled' => 1,
'rc_new' => 0, # obsolete
'rc_this_oldid' => $row->rev_id,
'rc_last_oldid' => isset($row->rc_last_oldid) ? $row->rc_last_oldid : 0,
'rc_bot' => 0,
- 'rc_moved_to_ns' => 0,
- 'rc_moved_to_title' => '',
'rc_ip' => '',
'rc_id' => $row->rc_id,
'rc_patrolled' => $row->rc_patrolled,
'rc_title',
'rc_cur_id',
'rc_type',
- 'rc_moved_to_ns',
- 'rc_moved_to_title',
'rc_deleted'
) );
* @access public
*/
public function extractRowInfo( $row ) {
- /* If page was moved somewhere, get the title of the move target. */
- $movedToTitle = false;
- if ( isset( $row->rc_moved_to_title ) && $row->rc_moved_to_title !== '' ) {
- $movedToTitle = Title::makeTitle( $row->rc_moved_to_ns, $row->rc_moved_to_title );
- }
-
/* Determine the title of the page that has been changed. */
$title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
/* Create a new entry in the result for the title. */
if ( $this->fld_title ) {
ApiQueryBase::addTitleInfo( $vals, $title );
- if ( $movedToTitle ) {
- ApiQueryBase::addTitleInfo( $vals, $movedToTitle, 'new_' );
- }
}
/* Add ids, such as rcid, pageid, revid, and oldid to the change's info. */
// 1.21
array( 'dropField', 'site_stats', 'ss_admins', 'patch-drop-ss_admins.sql' ),
+ array( 'dropField', 'recentchanges', 'rc_moved_to_title', 'patch-rc_moved.sql' ),
);
}
// 1.21
array( 'dropField', 'site_stats', 'ss_admins', 'patch-drop-ss_admins.sql' ),
+ array( 'dropField', 'recentchanges', 'rc_moved_to_title', 'patch-rc_moved.sql' ),
);
}
--- /dev/null
+-- rc_moved_to_ns and rc_moved_to_title is no longer used, delete the fields
+
+ALTER TABLE /*$wgDBprefix*/recentchanges DROP COLUMN rc_moved_to_ns,
+ DROP COLUMN rc_moved_to_title;
--- /dev/null
+-- rc_moved_to_ns and rc_moved_to_title is no longer used, delete the fields
+
+CREATE TABLE /*_*/recentchanges_tmp (
+ rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ rc_timestamp varbinary(14) NOT NULL default '',
+ rc_cur_time varbinary(14) NOT NULL default '',
+ rc_user int unsigned NOT NULL default 0,
+ rc_user_text varchar(255) binary NOT NULL,
+ rc_namespace int NOT NULL default 0,
+ rc_title varchar(255) binary NOT NULL default '',
+ rc_comment varchar(255) binary NOT NULL default '',
+ rc_minor tinyint unsigned NOT NULL default 0,
+ rc_bot tinyint unsigned NOT NULL default 0,
+ rc_new tinyint unsigned NOT NULL default 0,
+ rc_cur_id int unsigned NOT NULL default 0,
+ rc_this_oldid int unsigned NOT NULL default 0,
+ rc_last_oldid int unsigned NOT NULL default 0,
+ rc_type tinyint unsigned NOT NULL default 0,
+ rc_patrolled tinyint unsigned NOT NULL default 0,
+ rc_ip varbinary(40) NOT NULL default '',
+ rc_old_len int,
+ rc_new_len int,
+ rc_deleted tinyint unsigned NOT NULL default 0,
+ rc_logid int unsigned NOT NULL default 0,
+ rc_log_type varbinary(255) NULL default NULL,
+ rc_log_action varbinary(255) NULL default NULL,
+ rc_params blob NULL
+) /*$wgDBTableOptions*/;
+
+INSERT INTO /*_*/recentchanges_tmp
+ SELECT rc_id, rc_timestamp, rc_cur_time, rc_user, rc_user_text, rc_namespace, rc_title, rc_comment,
+ rc_minor, rc_bot, rc_new, rc_cur_id, rc_this_oldid, rc_last_oldid, rc_type, rc_patrolled, rc_ip,
+ rc_old_len, rc_new_len, rc_deleted, rc_logid, rc_log_type, rc_log_action, rc_params
+ FROM /*_*/recentchanges;
+
+DROP TABLE /*_*/recentchanges;
+
+ALTER TABLE /*_*/recentchanges_tmp RENAME TO /*_*/recentchanges;
+
+CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
+CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
+CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
+CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
+CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
+CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
+CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
-- The type of change entry (RC_EDIT,RC_NEW,RC_LOG)
rc_type tinyint unsigned NOT NULL default 0,
- -- These may no longer be used, with the new move log.
- rc_moved_to_ns tinyint unsigned NOT NULL default 0,
- rc_moved_to_title varchar(255) binary NOT NULL default '',
-
-- If the Recent Changes Patrol option is enabled,
-- users may mark edits as having been reviewed to
-- remove a warning flag on the RC list.
$end = $dbw->timestamp( $end );
$page = $dbw->tableName( 'page' );
- $sql = "SELECT rc_cur_id,rc_type,rc_moved_to_ns,rc_moved_to_title FROM $recentchanges
+ $sql = "SELECT rc_cur_id FROM $recentchanges
JOIN $page ON rc_cur_id=page_id AND rc_this_oldid=page_latest
- WHERE rc_timestamp BETWEEN '$start' AND '$end'
+ WHERE rc_type != " . RC_LOG . " AND rc_timestamp BETWEEN '$start' AND '$end'
";
$res = $dbw->query( $sql, __METHOD__ );
}
public function searchIndexUpdateCallback( $dbw, $row ) {
- if ( $row->rc_type == RC_MOVE || $row->rc_type == RC_MOVE_OVER_REDIRECT ) {
- # Rename searchindex entry
- $titleObj = Title::makeTitle( $row->rc_moved_to_ns, $row->rc_moved_to_title );
- $title = $titleObj->getPrefixedDBkey();
- $this->output( "$title..." );
- $u = new SearchUpdate( $row->rc_cur_id, $title, false );
- $u->doUpdate();
- $this->output( "\n" );
- } elseif ( $row->rc_type !== RC_LOG ) {
- $this->updateSearchIndexForPage( $dbw, $row->rc_cur_id );
- }
+ $this->updateSearchIndexForPage( $dbw, $row->rc_cur_id );
}
}