From 266a56db343aaca3ea2b8b4a3743c2027f1cc676 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Tue, 17 Oct 2023 17:51:28 +0800 Subject: [PATCH] executor, planner: fix plan_replayer zip format (#47474) (#47713) close pingcap/tidb#46474 --- executor/plan_replayer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/executor/plan_replayer.go b/executor/plan_replayer.go index b8fc52e45071d..21ff3cdacf515 100644 --- a/executor/plan_replayer.go +++ b/executor/plan_replayer.go @@ -483,7 +483,7 @@ func (e *PlanReplayerLoadInfo) Update(data []byte) error { continue } path := strings.Split(zipFile.Name, "/") - if len(path) == 2 && strings.Compare(path[0], "schema") == 0 { + if len(path) == 2 && strings.Compare(path[0], "schema") == 0 && zipFile.Mode().IsRegular() { err = createSchemaAndItems(e.Ctx, zipFile) if err != nil { return err @@ -500,7 +500,7 @@ func (e *PlanReplayerLoadInfo) Update(data []byte) error { // build view next for _, zipFile := range z.File { path := strings.Split(zipFile.Name, "/") - if len(path) == 2 && strings.Compare(path[0], "view") == 0 { + if len(path) == 2 && strings.Compare(path[0], "view") == 0 && zipFile.Mode().IsRegular() { err = createSchemaAndItems(e.Ctx, zipFile) if err != nil { return err @@ -511,7 +511,7 @@ func (e *PlanReplayerLoadInfo) Update(data []byte) error { // load stats for _, zipFile := range z.File { path := strings.Split(zipFile.Name, "/") - if len(path) == 2 && strings.Compare(path[0], "stats") == 0 { + if len(path) == 2 && strings.Compare(path[0], "stats") == 0 && zipFile.Mode().IsRegular() { err = loadStats(e.Ctx, zipFile) if err != nil { return err