Skip to content

Commit 15a52d8

Browse files
authored
planner: fix inner subq build process will ref-use outer's expand meta (#56424) (#56600)
close #56218
1 parent b6d4870 commit 15a52d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/planner/core/expression_rewriter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ func (er *expressionRewriter) buildSubquery(ctx context.Context, subq *ast.Subqu
328328
er.b.outerSchemas = append(er.b.outerSchemas, outerSchema)
329329
er.b.outerNames = append(er.b.outerNames, er.names)
330330
er.b.outerBlockExpand = append(er.b.outerBlockExpand, er.b.currentBlockExpand)
331+
// set it to nil, otherwise, inner qb will use outer expand meta to rewrite expressions.
332+
er.b.currentBlockExpand = nil
331333
defer func() {
332334
er.b.outerSchemas = er.b.outerSchemas[0 : len(er.b.outerSchemas)-1]
333335
er.b.outerNames = er.b.outerNames[0 : len(er.b.outerNames)-1]

0 commit comments

Comments
 (0)