diff --git a/dm/syncer/syncer.go b/dm/syncer/syncer.go index 5d860150ba1..d22becd2e50 100644 --- a/dm/syncer/syncer.go +++ b/dm/syncer/syncer.go @@ -2857,8 +2857,18 @@ func (s *Syncer) trackOriginDDL(ev *replication.QueryEvent, ec eventContext) (ma return nil, err } - affectedTbls := make(map[string]map[string]struct{}) for _, sql := range qec.splitDDLs { + sqls, err := s.ddlWorker.processOneDDL(qec, sql) + if err != nil { + s.tctx.L().Warn("processOneDDL failed", zap.Error(err)) + qec.appliedDDLs = append(qec.appliedDDLs, sql) + } else { + qec.appliedDDLs = append(qec.appliedDDLs, sqls...) + } + } + + affectedTbls := make(map[string]map[string]struct{}) + for _, sql := range qec.appliedDDLs { ddlInfo, err := s.ddlWorker.genDDLInfo(qec, sql) if err != nil { return nil, err