From: Brion Vibber Date: Fri, 20 Feb 2004 12:37:57 +0000 (+0000) Subject: Fix early finish problem introduced by dupe message fix X-Git-Tag: 1.3.0beta1~972 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=ce267a56955d6ef767fb1cb1350751e87148b530;p=lhc%2Fweb%2Fwiklou.git Fix early finish problem introduced by dupe message fix --- diff --git a/maintenance/compressOld.inc b/maintenance/compressOld.inc index 58bc9b45af..ff47e15f96 100644 --- a/maintenance/compressOld.inc +++ b/maintenance/compressOld.inc @@ -7,17 +7,19 @@ function compressOldPages( $start = 0 ) { print "Starting from old_id $start...\n"; do { $end = $start + $chunksize; - $sql = "SELECT old_id,old_flags,old_namespace,old_title,old_text FROM old WHERE old_id>=$start AND old_id<$end ORDER BY old_id LIMIT $chunksize"; + $sql = "SELECT old_id,old_flags,old_namespace,old_title,old_text FROM old WHERE old_id>=$start ORDER BY old_id LIMIT $chunksize"; $res = wfQuery( $sql, DB_READ, "compressOldPages" ); if( wfNumRows( $res ) == 0 ) { break; } + $last = $start; while( $row = wfFetchObject( $res ) ) { # print " {$row->old_id} - {$row->old_namespace}:{$row->old_title}\n"; compressPage( $row ); + $last = $row->old_id; } wfFreeResult( $res ); - $start += $chunksize; + $start = $last + 1; # Deletion may leave long empty stretches print "$start...\n"; } while( true ); }