mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add exists syntax check.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user