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