Skip to content

Commit

Permalink
planner: column pruning should use a shallow copy slice (#53237) (#53325
Browse files Browse the repository at this point in the history
)

close #52768
  • Loading branch information
ti-chi-bot authored May 16, 2024
1 parent 16be9dc commit 27b6278
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/planner/core/rule_column_pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"bytes"
"context"
"fmt"
"slices"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
Expand All @@ -34,7 +35,7 @@ type columnPruner struct {

func (*columnPruner) optimize(_ context.Context, lp LogicalPlan, opt *util.LogicalOptimizeOp) (LogicalPlan, bool, error) {
planChanged := false
lp, err := lp.PruneColumns(lp.Schema().Columns, opt)
lp, err := lp.PruneColumns(slices.Clone(lp.Schema().Columns), opt)
if err != nil {
return nil, planChanged, err
}
Expand Down

0 comments on commit 27b6278

Please sign in to comment.