From 1ba95a42a93b7942e98ca8056ae473957b8058e3 Mon Sep 17 00:00:00 2001 From: Zack Zhao <57036248+joccau@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:47:53 +0800 Subject: [PATCH] dm: handle the query in metadata from binlog (#11743) close pingcap/tiflow#11735 --- dm/pkg/dumpling/utils.go | 3 ++- dm/pkg/dumpling/utils_test.go | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dm/pkg/dumpling/utils.go b/dm/pkg/dumpling/utils.go index 0b6cf273917..01efb4b4f8d 100644 --- a/dm/pkg/dumpling/utils.go +++ b/dm/pkg/dumpling/utils.go @@ -123,7 +123,8 @@ func ParseMetaDataByReader(filename string, rd io.Reader) (*binlog.Location, *bi } switch line { - case "SHOW MASTER STATUS:": + case "SHOW BINARY LOG STATUS:", + "SHOW MASTER STATUS:": if err3 := parsePosAndGTID(&pos, >idStr); err3 != nil { return nil, nil, err3 } diff --git a/dm/pkg/dumpling/utils_test.go b/dm/pkg/dumpling/utils_test.go index 55bf0610a1c..7aa373e6b5a 100644 --- a/dm/pkg/dumpling/utils_test.go +++ b/dm/pkg/dumpling/utils_test.go @@ -84,6 +84,29 @@ Finished dump at: 2018-12-27 19:51:22`, mysql.Position{}, "", }, + { + `Started dump at: 2018-12-27 19:51:22 +SHOW BINARY LOG STATUS: + Log: mysql-bin.000004 + Pos: 3295818 + GTID: + +SHOW SLAVE STATUS: + Host: 10.128.27.98 + Log: mysql-bin.000003 + Pos: 329635 + GTID: + +Finished dump at: 2018-12-27 19:51:22`, + mysql.Position{ + Name: "mysql-bin.000004", + Pos: 3295818, + }, + "", + false, + mysql.Position{}, + "", + }, { // with empty line after multiple GTID sets `Started dump at: 2020-05-21 18:14:49 SHOW MASTER STATUS: