}
function getQueryInfo() {
- list( $index, $userCond ) = $this->getUserCond();
+ $userCond = [
+ // ->getJoin() below takes care of any joins needed
+ ActorMigration::newMigration()->getWhere(
+ wfGetDB( DB_REPLICA ), 'ar_user', User::newFromName( $this->target, false ), false
+ )['conds']
+ ];
$conds = array_merge( $userCond, $this->getNamespaceCond() );
$user = $this->getUser();
// Paranoia: avoid brute force searches (T19792)
}
$commentQuery = CommentStore::getStore()->getJoin( 'ar_comment' );
+ $actorQuery = ActorMigration::newMigration()->getJoin( 'ar_user' );
return [
- 'tables' => [ 'archive' ] + $commentQuery['tables'],
+ 'tables' => [ 'archive' ] + $commentQuery['tables'] + $actorQuery['tables'],
'fields' => [
'ar_rev_id', 'ar_namespace', 'ar_title', 'ar_timestamp',
- 'ar_minor_edit', 'ar_user', 'ar_user_text', 'ar_deleted'
- ] + $commentQuery['fields'],
+ 'ar_minor_edit', 'ar_deleted'
+ ] + $commentQuery['fields'] + $actorQuery['fields'],
'conds' => $conds,
- 'options' => [ 'USE INDEX' => [ 'archive' => $index ] ],
- 'join_conds' => $commentQuery['joins'],
+ 'options' => [],
+ 'join_conds' => $commentQuery['joins'] + $actorQuery['joins'],
];
}
return new FakeResultWrapper( $result );
}
- function getUserCond() {
- $condition = [];
-
- $condition['ar_user_text'] = $this->target;
- $index = 'ar_usertext_timestamp';
-
- return [ $index, $condition ];
- }
-
function getIndexField() {
return 'ar_timestamp';
}
'comment' => CommentStore::getStore()->getComment( 'ar_comment', $row )->text,
'user' => $row->ar_user,
'user_text' => $row->ar_user_text,
+ 'actor' => isset( $row->ar_actor ) ? $row->ar_actor : null,
'timestamp' => $row->ar_timestamp,
'minor_edit' => $row->ar_minor_edit,
'deleted' => $row->ar_deleted,