From 0eaa3af81598a576eead485d7b451bb6cba770f9 Mon Sep 17 00:00:00 2001 From: yuanruji Date: Mon, 20 Jan 2025 09:59:36 +0800 Subject: [PATCH] refactor(dbm-services): ignore mysqldump wanrning log #9138 --- .../db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go index 2604cf13ce..e101f3cb9f 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil/mysql_dumper.go @@ -291,12 +291,14 @@ func dumpIsOk(errLog string) (err error) { if err != nil { return err } + // ignore warning + w := regexp.MustCompile(`[Warning] Using a password on the command line interface can be insecure`) r := regexp.MustCompile(`Couldn't find table:`) var lines []string scanner := bufio.NewScanner(fd) for scanner.Scan() { l := scanner.Text() - if !r.MatchString(l) && lo.IsNotEmpty(l) { + if !r.MatchString(l) && lo.IsNotEmpty(l) && !w.MatchString(l) { lines = append(lines, l) } }