follow-up to r74742: fix typos
[lhc/web/wiklou.git] / maintenance / storage / compressOld.inc
index d79354f..69964ff 100644 (file)
@@ -18,12 +18,11 @@ function compressOldPages( $start = 0, $extdb = '' ) {
                        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 );
@@ -105,7 +104,8 @@ function compressWithConcat( $startId, $maxChunkSize, $beginDate,
        # 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 ) ) {
@@ -169,7 +169,7 @@ function compressWithConcat( $startId, $maxChunkSize, $beginDate,
                        $revLoadOptions
                );
                $revs = array();
-               while ( $revRow = $dbw->fetchObject( $revRes ) ) {
+               foreach ( $revRes as $revRow ) {
                        $revs[] = $revRow;
                }