maintenance: Fix paging in findMissingFiles.php
When there are more files as the batch size, the script loops as the where condition is not changed. Bug: T401088 Change-Id: Ic52ea24de0bd68db9e7d84e2f1b1067b20c2836d (cherry picked from commit 9a162bff8add74a1b797cf0769b8601d440cc231)
This commit is contained in:
parent
ebfb86b721
commit
9653fc56ad
1 changed files with 3 additions and 2 deletions
|
|
@ -47,7 +47,6 @@ class FindMissingFiles extends Maintenance {
|
|||
$queryBuilder = $dbr->newSelectQueryBuilder()
|
||||
->select( [ 'name' => 'img_name' ] )
|
||||
->from( 'image' )
|
||||
->where( $dbr->expr( 'img_name', '>', $lastName ) )
|
||||
->groupBy( 'name' )
|
||||
->orderBy( 'name' )
|
||||
->limit( $batchSize );
|
||||
|
|
@ -67,7 +66,9 @@ class FindMissingFiles extends Maintenance {
|
|||
}
|
||||
|
||||
do {
|
||||
$res = $queryBuilder->caller( __METHOD__ )->fetchResultSet();
|
||||
$res = ( clone $queryBuilder )
|
||||
->where( $dbr->expr( 'img_name', '>', $lastName ) )
|
||||
->caller( __METHOD__ )->fetchResultSet();
|
||||
|
||||
// Check if any of these files are missing...
|
||||
$pathsByName = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue