@@ 312-321 (lines=10) @@ | ||
309 | $dbr = wfGetDB( DB_REPLICA ); |
|
310 | $i = 0; |
|
311 | $startId = 0; |
|
312 | if ( $this->noCount ) { |
|
313 | $numPages = '[unknown]'; |
|
314 | } else { |
|
315 | $numPages = $dbr->selectField( 'blob_tracking', |
|
316 | 'COUNT(DISTINCT bt_page)', |
|
317 | # A condition is required so that this query uses the index |
|
318 | [ 'bt_moved' => 0 ], |
|
319 | __METHOD__ |
|
320 | ); |
|
321 | } |
|
322 | if ( $this->copyOnly ) { |
|
323 | $this->info( "Copying pages..." ); |
|
324 | } else { |
|
@@ 381-391 (lines=11) @@ | ||
378 | $dbr = wfGetDB( DB_REPLICA ); |
|
379 | $startId = 0; |
|
380 | $i = 0; |
|
381 | if ( $this->noCount ) { |
|
382 | $numOrphans = '[unknown]'; |
|
383 | } else { |
|
384 | $numOrphans = $dbr->selectField( 'blob_tracking', |
|
385 | 'COUNT(DISTINCT bt_text_id)', |
|
386 | [ 'bt_moved' => 0, 'bt_page' => 0 ], |
|
387 | __METHOD__ ); |
|
388 | if ( !$numOrphans ) { |
|
389 | return; |
|
390 | } |
|
391 | } |
|
392 | if ( $this->copyOnly ) { |
|
393 | $this->info( "Copying orphans..." ); |
|
394 | } else { |