use of com.alibaba.cobar.parser.ast.expression.misc.SubqueryAnyExpression in project cobar by alibaba.
the class MySQLExprParser method anyAllExpression.
private Expression anyAllExpression() throws SQLSyntaxErrorException {
QueryExpression subquery = null;
switch(lexer.token()) {
case KW_ALL:
lexer.nextToken();
match(PUNC_LEFT_PAREN);
subquery = subQuery();
match(PUNC_RIGHT_PAREN);
return new SubqueryAllExpression(subquery).setCacheEvalRst(cacheEvalRst);
default:
int matchIndex = equalsIdentifier("SOME", "ANY");
if (matchIndex < 0) {
return bitOrExpression(null, null);
}
String consumed = lexer.stringValue();
String consumedUp = lexer.stringValueUppercase();
if (lexer.nextToken() == PUNC_LEFT_PAREN) {
lexer.nextToken();
subquery = subQuery();
match(PUNC_RIGHT_PAREN);
return new SubqueryAnyExpression(subquery).setCacheEvalRst(cacheEvalRst);
}
return bitOrExpression(consumed, consumedUp);
}
}
Aggregations