Skip to content

Commit

Permalink
fix(dbm-services): 如果SQL中create database 已经存在使得错误在模拟执行抛出来 #8693
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq authored and iSecloud committed Dec 18, 2024
1 parent 4a532ce commit 999a977
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ func (c *SemanticDumpSchemaComp) getDumpdbs(alldbs []string, version string) (re
finaldbs = append(finaldbs, db)
}
} else {
if len(lo.Intersect(alldbs, c.Params.ParseCreateDbs)) > 0 {
err = fmt.Errorf("create dbs %v,已经存在目标实例中", c.Params.ParseCreateDbs)
return nil, err
}
for _, f := range c.Params.ExecuteObjects {
var realexcutedbs []string
// 获得目标库 因为是通配符 所以需要获取完整名称
Expand All @@ -226,7 +222,9 @@ func (c *SemanticDumpSchemaComp) getDumpdbs(alldbs []string, version string) (re
realexcutedbs = util.FilterOutStringSlice(intentionDbs, ignoreDbs)
finaldbs = append(finaldbs, realexcutedbs...)
}
createSQLExistDbs := lo.Intersect(alldbs, c.Params.ParseCreateDbs)
finaldbs = append(finaldbs, c.Params.ParseNeedDumpDbs...)
finaldbs = append(finaldbs, createSQLExistDbs...)
}
logger.Info("dump dbs:%v", finaldbs)
return finaldbs, nil
Expand Down

0 comments on commit 999a977

Please sign in to comment.