From: Kevin Israel Date: Fri, 31 Jul 2015 22:16:24 +0000 (-0400) Subject: refreshLinks.php: Fix deletion of link entries from nonexistent pages X-Git-Tag: 1.31.0-rc.0~10457^2~1 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=6a1e956428adea767bba30093a64d0c2ba350bb4;p=lhc%2Fweb%2Fwiklou.git refreshLinks.php: Fix deletion of link entries from nonexistent pages After checking a chunk of one of the links tables, the script failed to restore the original chunk start when checking the next table. Follows-up a1e005155921. Bug: T107632 Change-Id: I21678bc3c83946f2e62afe3fdc69c7e84678ceeb --- diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 5d311add60..f6c721f91a 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -327,13 +327,14 @@ class RefreshLinks extends Maintenance { foreach ( $linksTables as $table => $field ) { $this->output( " $table: 0" ); + $tableStart = $start; $counter = 0; do { $ids = $dbr->selectFieldValues( $table, $field, array( - self::intervalCond( $dbr, $field, $start, $end ), + self::intervalCond( $dbr, $field, $tableStart, $end ), "$field NOT IN ({$dbr->selectSQLText( 'page', 'page_id' )})", ), __METHOD__, @@ -346,10 +347,10 @@ class RefreshLinks extends Maintenance { wfWaitForSlaves(); $dbw->delete( $table, array( $field => $ids ), __METHOD__ ); $this->output( ", $counter" ); - $start = $ids[$numIds - 1] + 1; + $tableStart = $ids[$numIds - 1] + 1; } - } while ( $numIds >= $batchSize && ( $end === null || $start <= $end ) ); + } while ( $numIds >= $batchSize && ( $end === null || $tableStart <= $end ) ); $this->output( " deleted.\n" );