use of com.alibaba.cobar.parser.ast.expression.primary.function.datetime.Timestampadd in project cobar by alibaba.
the class MySQLExprParser method timestampadd.
/**
* first '(' has been consumed
*/
private Timestampadd timestampadd() throws SQLSyntaxErrorException {
IntervalPrimary.Unit unit = intervalPrimaryUnit();
match(PUNC_COMMA);
Expression interval = expression();
match(PUNC_COMMA);
Expression expr = expression();
match(PUNC_RIGHT_PAREN);
List<Expression> argument = new ArrayList<Expression>(2);
argument.add(interval);
argument.add(expr);
Timestampadd func = new Timestampadd(unit, argument);
func.setCacheEvalRst(cacheEvalRst);
return func;
}
Aggregations