diff --git a/ast/functions.go b/ast/functions.go index 7faab4c6e1..1fb30a4a64 100644 --- a/ast/functions.go +++ b/ast/functions.go @@ -375,11 +375,11 @@ func (n *FuncDateArithExpr) Accept(v Visitor) (Node, bool) { n.Date = node.(ExprNode) } if n.Interval != nil { - node, ok := n.Date.Accept(v) + node, ok := n.Interval.Accept(v) if !ok { return n, false } - n.Date = node.(ExprNode) + n.Interval = node.(ExprNode) } return v.Leave(n) } diff --git a/expression/visitor.go b/expression/visitor.go index 6646d59db7..80c5ab46d9 100644 --- a/expression/visitor.go +++ b/expression/visitor.go @@ -108,7 +108,7 @@ type Visitor interface { VisitFunctionTrim(v *FunctionTrim) (Expression, error) // VisitDateArith visits DateArith expression. - VisitDateArith(dc *DateArith) (Expression, error) + VisitDateArith(da *DateArith) (Expression, error) } // BaseVisitor is the base implementation of Visitor.