Skip to content

Commit

Permalink
fix dump db
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq committed Dec 9, 2024
1 parent df2445e commit 06899e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ func (c *SemanticDumpSchemaComp) Init() (err error) {

func (c *SemanticDumpSchemaComp) getDumpdbs(alldbs []string, version string) (realexcutedbs []string, err error) {
finaldbs := []string{}
dbsExcluesysdbs := computil.GetGcsSystemDatabasesIgnoreTest(version)
dbsExcluesysdbs := util.FilterOutStringSlice(alldbs, computil.GetGcsSystemDatabasesIgnoreTest(version))
if c.Params.DumpAll {
logger.Info("param is dump all")
reg := regexp.MustCompile(`^bak_cbs`)
newBackupDbreg := regexp.MustCompile(`^stage_truncate`)
for _, db := range util.FilterOutStringSlice(alldbs, dbsExcluesysdbs) {
for _, db := range dbsExcluesysdbs {
if reg.MatchString(db) {
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ func (m *MySQLDumperTogether) Dump() (err error) {
dumpOption = m.getTMySQLDumpOption()
}
defer func() {
errFileContext, e1 := osutil.ReadFileString(errFile)
if e1 != nil {
logger.Error("read errFile failed %s", e1.Error())
if err != nil {
errFileContext, e1 := osutil.ReadFileString(errFile)
if e1 != nil {
logger.Error("read errFile failed %s", e1.Error())
}
logger.Error("errFile:%s", errFileContext)
}
logger.Error("errFile:%s", errFileContext)
}()
dumpCmd := m.getDumpCmd(outputFile, errFile, dumpOption)
logger.Info("mysqldump cmd:%s", mysqlcomm.ClearSensitiveInformation(dumpCmd))
Expand Down

0 comments on commit 06899e0

Please sign in to comment.