Skip to content

Commit f06860e

Browse files
committed
fix table as
Signed-off-by: wjhuang2016 <[email protected]>
1 parent 7219ffa commit f06860e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

planner/core/logical_plan_builder.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,6 +3649,15 @@ func (b *PlanBuilder) buildDataSource(ctx context.Context, tn *ast.TableName, as
36493649
p := LogicalCTE{cte: &CTEClass{IsDistinct: cte.isDistinct, seedPartLogicalPlan: cte.seedLP, recursivePartLogicalPlan: cte.recurLP, IdForStorage: cte.storageID, optFlag: cte.optFlag}}.Init(b.ctx, b.getSelectOffset())
36503650
p.SetSchema(cte.seedLP.Schema())
36513651
p.SetOutputNames(cte.seedLP.OutputNames())
3652+
if len(asName.String()) > 0 {
3653+
on := p.OutputNames()
3654+
for i := range on {
3655+
cpOn := *on[i]
3656+
on[i] = &cpOn
3657+
on[i].TblName = *asName
3658+
}
3659+
p.SetOutputNames(on)
3660+
}
36523661
return p, nil
36533662
}
36543663
}

0 commit comments

Comments
 (0)