Merge pull request #171 from github/empty-table-progress

progress is 100% when 0/0 rows copied
This commit is contained in:
Shlomi Noach 2016-08-19 08:27:04 +02:00 committed by GitHub
commit 1e88dbd04a

View File

@ -941,7 +941,9 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
totalRowsCopied := this.migrationContext.GetTotalRowsCopied()
rowsEstimate := atomic.LoadInt64(&this.migrationContext.RowsEstimate)
var progressPct float64
if rowsEstimate > 0 {
if rowsEstimate == 0 {
progressPct = 100.0
} else {
progressPct = 100.0 * float64(totalRowsCopied) / float64(rowsEstimate)
}