Skip to content

Commit

Permalink
planner: fix inner subq build process will ref-use outer's expand meta (
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Oct 12, 2024
1 parent b6d4870 commit 15a52d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/planner/core/expression_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ func (er *expressionRewriter) buildSubquery(ctx context.Context, subq *ast.Subqu
er.b.outerSchemas = append(er.b.outerSchemas, outerSchema)
er.b.outerNames = append(er.b.outerNames, er.names)
er.b.outerBlockExpand = append(er.b.outerBlockExpand, er.b.currentBlockExpand)
// set it to nil, otherwise, inner qb will use outer expand meta to rewrite expressions.
er.b.currentBlockExpand = nil
defer func() {
er.b.outerSchemas = er.b.outerSchemas[0 : len(er.b.outerSchemas)-1]
er.b.outerNames = er.b.outerNames[0 : len(er.b.outerNames)-1]
Expand Down

0 comments on commit 15a52d8

Please sign in to comment.