add exists syntax check.

This commit is contained in:
wenshao
2017-12-26 11:24:36 +08:00
parent 2b1339c633
commit c451043c82
3 changed files with 46 additions and 0 deletions
@@ -1064,6 +1064,12 @@ public class SQLExprParser extends SQLParser {
exprList(methodInvokeExpr.getParameters(), methodInvokeExpr);
}
if (hash_lower == FnvHash.Constants.EXIST
&& methodInvokeExpr.getParameters().size() == 1
&& methodInvokeExpr.getParameters().get(0) instanceof SQLQueryExpr) {
throw new ParserException("exists syntax error.");
}
if (lexer.token == Token.FROM) {
lexer.nextToken();
SQLExpr from = this.expr();
@@ -629,5 +629,6 @@ public final class FnvHash {
long BUILD = fnv1a_64_lower("BUILD");
long NOCACHE = fnv1a_64_lower("NOCACHE");
long NOPARALLEL = fnv1a_64_lower("NOPARALLEL");
long EXIST = fnv1a_64_lower("EXIST");
}
}