Skip to content

Commit

Permalink
parser,ast: fix the TiDB issue #8153 (pingcap#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjoa authored and zz-jason committed Oct 3, 2019
1 parent e998b3c commit cce7a95
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 @@ -701,6 +701,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 @@ -717,6 +719,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 cce7a95

Please sign in to comment.