Skip to content

Commit

Permalink
Clone the originalSchema
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 committed Nov 22, 2023
1 parent 0fd354c commit 1168a6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/planner/core/rule_join_reorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ func (s *joinReOrderSolver) optimizeRecursive(ctx sessionctx.Context, p LogicalP
proj := LogicalProjection{
Exprs: expression.Column2Exprs(originalSchema.Columns),
}.Init(p.SCtx(), p.SelectBlockOffset())
proj.SetSchema(originalSchema)
// Clone the schema here, because the schema may be changed by the projection optimization later.
proj.SetSchema(originalSchema.Clone())
proj.SetChildren(p)
p = proj
}
Expand Down

0 comments on commit 1168a6e

Please sign in to comment.