From 901577417799cf97b6b18173a06c6b800cce4e60 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Tue, 17 Oct 2023 22:36:29 +0800 Subject: [PATCH] executor, planner: fix plan_replayer zip format (#47474) (#47714) 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 490e65ef96dd2..b158d5dc10a08 100644 --- a/executor/plan_replayer.go +++ b/executor/plan_replayer.go @@ -437,7 +437,7 @@ func (e *PlanReplayerLoadInfo) Update(data []byte) error { // build schema and table first for _, zipFile := range z.File { 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 @@ -454,7 +454,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 @@ -465,7 +465,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