Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231898

Change subject: Migration script: Set last revision ID when ignoring a row
......................................................................

Migration script: Set last revision ID when ignoring a row

Otherwise you enter an infinite loop when you ignore all rows in a batch

Bug: T62373
Change-Id: I08b3920940a1f60cd6d0ca03bd95262af0e02025
---
M migrateToRevDel.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Oversight 
refs/changes/98/231898/1

diff --git a/migrateToRevDel.php b/migrateToRevDel.php
index 0cc38ca..87088d2 100644
--- a/migrateToRevDel.php
+++ b/migrateToRevDel.php
@@ -121,12 +121,14 @@
                                array( 'LIMIT' => $this->mBatchSize, 'ORDER BY' 
=> 'hidden_rev_id' ),
                                array( 'user' => array( 'INNER JOIN', 'user_id 
= hidden_by_user' ) )
                        );
+
                        $insertLoggingData = array();
                        $insertRevisionData = array();
                        $insertArchiveData = array();
                        foreach ( $hiddenRows as $hiddenRow ) {
                                if ( Revision::newFromId( 
$hiddenRow->hidden_rev_id ) ) {
                                        $this->output( "Ignoring revision 
{$hiddenRow->hidden_rev_id} as it is already in the revision table.\n" );
+                                       $lastRevId = $hiddenRow->hidden_rev_id;
                                        continue;
                                }
                                $insertData = array();
@@ -171,6 +173,7 @@
                                        __METHOD__
                                ) ) {
                                        $this->output( "Ignoring revision 
{$hiddenRow->hidden_rev_id} as it is already in the archive table.\n" );
+                                       $lastRevId = $hiddenRow->hidden_rev_id;
                                        continue;
                                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/231898
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08b3920940a1f60cd6d0ca03bd95262af0e02025
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Oversight
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to