Skip to content

Commit

Permalink
fix plan_replayer zip format
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
  • Loading branch information
YangKeao committed Oct 9, 2023
1 parent 603a15f commit d3ae80b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions executor/plan_replayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Check warning on line 489 in executor/plan_replayer.go

View check run for this annotation

Codecov / codecov/patch

executor/plan_replayer.go#L489

Added line #L489 was not covered by tests
err = createSchemaAndItems(e.Ctx, zipFile)
if err != nil {
return err
Expand All @@ -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() {

Check warning on line 506 in executor/plan_replayer.go

View check run for this annotation

Codecov / codecov/patch

executor/plan_replayer.go#L506

Added line #L506 was not covered by tests
err = createSchemaAndItems(e.Ctx, zipFile)
if err != nil {
return err
Expand All @@ -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() {

Check warning on line 517 in executor/plan_replayer.go

View check run for this annotation

Codecov / codecov/patch

executor/plan_replayer.go#L517

Added line #L517 was not covered by tests
err = loadStats(e.Ctx, zipFile)
if err != nil {
return err
Expand Down

0 comments on commit d3ae80b

Please sign in to comment.