return;
}
+ $insertOpts = [ 'IGNORE' ];
+ $selectOpts = [];
+
+ // If wl_id exists, make insertSelect() more replication-safe by
+ // ordering on that column. If not, hint that it should be safe anyway.
+ if ( $this->db->fieldExists( 'watchlist', 'wl_id', __METHOD__ ) ) {
+ $selectOpts['ORDER BY'] = 'wl_id';
+ } else {
+ $insertOpts[] = 'NO_AUTO_COLUMNS';
+ }
+
$this->output( "Adding missing watchlist talk page rows... " );
$this->db->insertSelect( 'watchlist', 'watchlist',
[
'wl_namespace' => 'wl_namespace | 1',
'wl_title' => 'wl_title',
'wl_notificationtimestamp' => 'wl_notificationtimestamp'
- ], [ 'NOT (wl_namespace & 1)' ], __METHOD__, 'IGNORE' );
+ ], [ 'NOT (wl_namespace & 1)' ], __METHOD__, $insertOpts, $selectOpts );
$this->output( "done.\n" );
$this->output( "Adding missing watchlist subject page rows... " );
'wl_namespace' => 'wl_namespace & ~1',
'wl_title' => 'wl_title',
'wl_notificationtimestamp' => 'wl_notificationtimestamp'
- ], [ 'wl_namespace & 1' ], __METHOD__, 'IGNORE' );
+ ], [ 'wl_namespace & 1' ], __METHOD__, $insertOpts, $selectOpts );
$this->output( "done.\n" );
}
'tl_title' => 'pl_title'
], [
'pl_namespace' => 10
- ], __METHOD__
+ ], __METHOD__,
+ [ 'NO_AUTO_COLUMNS' ] // There's no "tl_id" auto-increment field
);
}
$this->output( "Done. Please run maintenance/refreshLinks.php for a more " .