$userIter = call_user_func( function () use ( $dbSecondary, $sort, $op, $fname ) {
global $wgActorTableSchemaMigrationStage;
- $from = $fromName = false;
+ $fromName = false;
if ( !is_null( $this->params['continue'] ) ) {
$continue = explode( '|', $this->params['continue'] );
$this->dieContinueUsageIf( count( $continue ) != 4 );
$this->dieContinueUsageIf( $continue[0] !== 'name' );
$fromName = $continue[1];
- $from = "$op= " . $dbSecondary->addQuotes( $fromName );
}
$like = $dbSecondary->buildLike( $this->params['userprefix'], $dbSecondary->anyString() );
$limit = 501;
do {
+ $from = $fromName ? "$op= " . $dbSecondary->addQuotes( $fromName ) : false;
+
// For the new schema, pull from the actor table. For the
// old, pull from rev_user. For migration a FULL [OUTER]
// JOIN would be what we want, except MySQL doesn't support
}
$count = 0;
- $from = null;
+ $fromName = false;
foreach ( $res as $row ) {
if ( ++$count >= $limit ) {
- $from = $row->user_name;
+ $fromName = $row->user_name;
break;
}
yield User::newFromRow( $row );
}
- } while ( $from !== null );
+ } while ( $fromName !== false );
} );
// Do the actual sorting client-side, because otherwise
// prepareQuery might try to sort by actor and confuse everything.
if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
+ || ( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
+ || ( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
|| ( isset( $show['top'] ) && isset( $show['!top'] ) )
|| ( isset( $show['new'] ) && isset( $show['!new'] ) )
) {
$this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
$this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );
- $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
- $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
+ $this->addWhereIf(
+ 'rc_patrolled = ' . RecentChange::PRC_UNPATROLLED,
+ isset( $show['!patrolled'] )
+ );
+ $this->addWhereIf(
+ 'rc_patrolled != ' . RecentChange::PRC_UNPATROLLED,
+ isset( $show['patrolled'] )
+ );
+ $this->addWhereIf(
+ 'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED,
+ isset( $show['!autopatrolled'] )
+ );
+ $this->addWhereIf(
+ 'rc_patrolled = ' . RecentChange::PRC_AUTOPATROLLED,
+ isset( $show['autopatrolled'] )
+ );
$this->addWhereIf( $idField . ' != page_latest', isset( $show['!top'] ) );
$this->addWhereIf( $idField . ' = page_latest', isset( $show['top'] ) );
$this->addWhereIf( 'rev_parent_id != 0', isset( $show['!new'] ) );
$this->addOption( 'LIMIT', $limit + 1 );
if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ||
- $this->fld_patrolled
+ isset( $show['autopatrolled'] ) || isset( $show['!autopatrolled'] ) || $this->fld_patrolled
) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
$this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
}
+ $isFilterset = isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ||
+ isset( $show['autopatrolled'] ) || isset( $show['!autopatrolled'] );
$this->addTables( 'recentchanges' );
$this->addJoinConds( [ 'recentchanges' => [
- isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ? 'JOIN' : 'LEFT JOIN',
+ $isFilterset ? 'JOIN' : 'LEFT JOIN',
[
// This is a crazy hack. recentchanges has no index on rc_this_oldid, so instead of adding
// one T19237 did a join using rc_user_text and rc_timestamp instead. Now rc_user_text is
}
if ( $this->fld_patrolled ) {
- $vals['patrolled'] = (bool)$row->rc_patrolled;
+ $vals['patrolled'] = $row->rc_patrolled != RecentChange::PRC_UNPATROLLED;
+ $vals['autopatrolled'] = $row->rc_patrolled == RecentChange::PRC_AUTOPATROLLED;
}
if ( $this->fld_size && !is_null( $row->rev_len ) ) {
'!minor',
'patrolled',
'!patrolled',
+ 'autopatrolled',
+ '!autopatrolled',
'top',
'!top',
'new',