break;
}
$last = $start;
- while( $row = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
# print " {$row->old_id} - {$row->old_namespace}:{$row->old_title}\n";
compressPage( $row, $extdb );
$last = $row->old_id;
}
- $dbw->freeResult( $res );
$start = $last + 1; # Deletion may leave long empty stretches
print "$start...\n";
} while( true );
'old_text' => $compress
), array( /* WHERE */
'old_id' => $row->old_id
- ), $fname, 'LIMIT 1'
+ ), $fname,
+ array( 'LIMIT' => 1 )
);
return true;
}
# overwriting bulk storage concat rows. Don't compress external references, because
# the script doesn't yet delete rows from external storage.
$conds = array(
- "old_flags NOT LIKE '%object%' AND old_flags NOT LIKE '%external%'");
+ 'old_flags NOT ' . $dbr->buildLike( $dbr->anyString(), 'object', $dbr->anyString() ) . ' AND old_flags NOT '
+ . $dbr->buildLike( $dbr->anyString(), 'external', $dbr->anyString() ) );
if ( $beginDate ) {
if ( !preg_match( '/^\d{14}$/', $beginDate ) ) {
$revLoadOptions
);
$revs = array();
- while ( $revRow = $dbw->fetchObject( $revRes ) ) {
+ foreach ( $revRes as $revRow ) {
$revs[] = $revRow;
}