$this->error( "archive table does not exist", true );
} elseif ( !$db->fieldExists( 'revision', 'rev_len', __METHOD__ ) ) {
$this->output( "rev_len column does not exist\n\n", true );
+
return false;
}
$this->output( "Populating ar_len column\n" );
$ar = $this->doLenUpdates( 'archive', 'ar_id', 'ar', Revision::selectArchiveFields() );
- $this->output( "rev_len and ar_len population complete [$rev revision rows, $ar archive rows].\n" );
+ $this->output( "rev_len and ar_len population complete "
+ . "[$rev revision rows, $ar archive rows].\n" );
+
return true;
}
$end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
if ( !$start || !$end ) {
$this->output( "...$table table seems to be empty.\n" );
+
return 0;
}
__METHOD__
);
- $db->begin( __METHOD__ );
+ $this->beginTransaction( $db, __METHOD__ );
# Go through and update rev_len from these rows.
foreach ( $res as $row ) {
if ( $this->upgradeRow( $row, $table, $idCol, $prefix ) ) {
$count++;
}
}
- $db->commit( __METHOD__ );
+ $this->commitTransaction( $db, __METHOD__ );
$blockStart += $this->mBatchSize;
$blockEnd += $this->mBatchSize;
}
/**
- * @param $row
+ * @param stdClass $row
* @param string $table
* @param string $idCol
* @param string $prefix
# This should not happen, but sometimes does (bug 20757)
$id = $row->$idCol;
$this->output( "Content of $table $id unavailable!\n" );
+
return false;
}