+
+ $field = $dbw->fieldInfo( 'recentchanges', 'rc_cur_id' );
+
+ $inserted = 0;
+ foreach ( $res as $row ) {
+ $dbw->insert(
+ 'recentchanges',
+ [
+ 'rc_timestamp' => $row->log_timestamp,
+ 'rc_user' => $row->log_user,
+ 'rc_user_text' => $row->user_name,
+ 'rc_namespace' => $row->log_namespace,
+ 'rc_title' => $row->log_title,
+ 'rc_comment' => $row->log_comment,
+ 'rc_minor' => 0,
+ 'rc_bot' => 0,
+ 'rc_patrolled' => 1,
+ 'rc_new' => 0,
+ 'rc_this_oldid' => 0,
+ 'rc_last_oldid' => 0,
+ 'rc_type' => RC_LOG,
+ 'rc_source' => RecentChange::SRC_LOG,
+ 'rc_cur_id' => $field->isNullable()
+ ? $row->page_id
+ : (int)$row->page_id, // NULL => 0,
+ 'rc_log_type' => $row->log_type,
+ 'rc_log_action' => $row->log_action,
+ 'rc_logid' => $row->log_id,
+ 'rc_params' => $row->log_params,
+ 'rc_deleted' => $row->log_deleted
+ ],
+ __METHOD__
+ );
+
+ if ( ( ++$inserted % $this->mBatchSize ) == 0 ) {
+ wfGetLBFactory()->waitForReplication();
+ }
+ }