From d3ae80b05caf4df7c00dfa1411441fd595f6c604 Mon Sep 17 00:00:00 2001 From: Yang Keao Date: Mon, 9 Oct 2023 14:26:36 +0800 Subject: [PATCH] fix plan_replayer zip format Signed-off-by: Yang Keao --- 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 36f958b656e1f..2627a6c1ea8b6 100644 --- a/executor/plan_replayer.go +++ b/executor/plan_replayer.go @@ -486,7 +486,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 @@ -503,7 +503,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 @@ -514,7 +514,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