Skip to content

Commit fee2597

Browse files
committed
fix: 修复未正确解析备份语句时的状态标计
1 parent 2b3f6e9 commit fee2597

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

session/parser.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (s *session) parserBinlog(ctx context.Context) {
308308
}
309309

310310
// log.Errorf("binlog pos: %d", int(currentPosition.Pos))
311-
// log.Errorf("binlog pos: %v", e.Header.EventType.String())
311+
// log.Errorf("binlog type: %#v,%#v", e.Header.EventType, e.Header.EventType.String())
312312
// log.Errorf("currentThreadID: %v", currentThreadID)
313313
// e.Dump(os.Stdout)
314314
// os.Stdout.Sync()
@@ -389,11 +389,14 @@ func (s *session) parserBinlog(ctx context.Context) {
389389
// if (record.StageStatus == StatusExecFail && record.AffectedRows > 0) ||
390390
// record.StageStatus == StatusExecOK || record.StageStatus == StatusBackupFail {
391391
if record.AffectedRows > 0 {
392-
record.StageStatus = StatusBackupOK
392+
if changeRows >= record.AffectedRows {
393+
record.StageStatus = StatusBackupOK
394+
}
393395
}
394396

395397
record.BackupCostTime = fmt.Sprintf("%.3f", time.Since(startTime).Seconds())
396398

399+
changeRows = 0
397400
next := s.getNextBackupRecord()
398401
if next != nil {
399402
startPosition = mysql.Position{Name: next.StartFile,

0 commit comments

Comments
 (0)