Skip to content

Commit

Permalink
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 shenli committed Nov 10, 2018
1 parent a63108d commit de9982e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 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 de9982e

Please sign in to comment.