Skip to content

Commit

Permalink
[parser] parser,ast: fix the TiDB issue #8153 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjoa authored and ti-chi-bot committed Oct 9, 2021
1 parent 5fe32fe commit c94a71f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parser/ast/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ type PositionExpr struct {
exprNode
// N is the position, started from 1 now.
N int
// P is the parameterized position.
P ExprNode
// Refer is the result field the position refers to.
Refer *ResultField
}
Expand All @@ -716,6 +718,13 @@ func (n *PositionExpr) Accept(v Visitor) (Node, bool) {
return v.Leave(newNode)
}
n = newNode.(*PositionExpr)
if n.P != nil {
node, ok := n.P.Accept(v)
if !ok {
return n, false
}
n.P = node.(ExprNode)
}
return v.Leave(n)
}

Expand Down

0 comments on commit c94a71f

Please sign in to comment.