simplified error logic; fixed incorrect RowsEstimate handling on error

This commit is contained in:
Shlomi Noach 2016-08-18 13:38:23 +02:00
parent 74593ec010
commit 75e0d12302

View File

@ -880,15 +880,14 @@ func (this *Applier) ApplyDMLEventQuery(dmlEvent *binlog.BinlogDMLEvent) error {
return nil
}()
if err == nil {
atomic.AddInt64(&this.migrationContext.TotalDMLEventsApplied, 1)
if err != nil {
err = fmt.Errorf("%s; query=%s; args=%+v", err.Error(), query, args)
return log.Errore(err)
}
// no error
atomic.AddInt64(&this.migrationContext.TotalDMLEventsApplied, 1)
if this.migrationContext.CountTableRows {
atomic.AddInt64(&this.migrationContext.RowsEstimate, rowDelta)
}
if err != nil {
err = fmt.Errorf("%s; query=%s; args=%+v", err.Error(), query, args)
log.Errore(err)
}
return err
return nil
}