mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve WallFilter
This commit is contained in:
@@ -706,12 +706,12 @@ public class SQLExprParser extends SQLParser {
|
||||
exprList(aggregateExpr.getArguments());
|
||||
|
||||
accept(Token.RPAREN);
|
||||
|
||||
|
||||
if (lexer.token() == Token.OVER) {
|
||||
lexer.nextToken();
|
||||
SQLOver over = new SQLOver();
|
||||
accept(Token.LPAREN);
|
||||
|
||||
|
||||
if (identifierEquals("PARTITION")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.BY);
|
||||
@@ -725,13 +725,12 @@ public class SQLExprParser extends SQLParser {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
over.setOrderBy(parseOrderBy());
|
||||
|
||||
|
||||
// if (over.getOrderBy() != null) {
|
||||
// //TODO window
|
||||
// }
|
||||
|
||||
|
||||
accept(Token.RPAREN);
|
||||
aggregateExpr.setOver(over);
|
||||
|
||||
@@ -1133,16 +1132,16 @@ public class SQLExprParser extends SQLParser {
|
||||
|
||||
SQLName typeExpr = name();
|
||||
String typeName = typeExpr.toString();
|
||||
|
||||
|
||||
if (isCharType(typeName)) {
|
||||
SQLCharactorDataType charType = new SQLCharactorDataType(typeName);
|
||||
|
||||
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
charType.getArguments().add(this.expr());
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
|
||||
return parseCharTypeRest(charType);
|
||||
}
|
||||
|
||||
@@ -1205,8 +1204,8 @@ public class SQLExprParser extends SQLParser {
|
||||
if (lexer.token() == token) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new SQLParseException("syntax error, expect " + token + ", actual " + lexer.token() + " "
|
||||
+ lexer.stringVal());
|
||||
throw new ParserException("syntax error, expect " + token + ", actual " + lexer.token() + " "
|
||||
+ lexer.stringVal());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1237,19 +1236,19 @@ public class SQLExprParser extends SQLParser {
|
||||
column.setDefaultExpr(new SQLNullExpr());
|
||||
return parseColumnRest(column);
|
||||
}
|
||||
|
||||
|
||||
if (lexer.token == Token.PRIMARY) {
|
||||
lexer.nextToken();
|
||||
accept(Token.KEY);
|
||||
column.getConstaints().add(new SQLColumnPrimaryKey());
|
||||
return parseColumnRest(column);
|
||||
return parseColumnRest(column);
|
||||
}
|
||||
|
||||
|
||||
if (lexer.token == Token.UNION) {
|
||||
lexer.nextToken();
|
||||
accept(Token.KEY);
|
||||
column.getConstaints().add(new SQLColumnPrimaryKey());
|
||||
return parseColumnRest(column);
|
||||
return parseColumnRest(column);
|
||||
}
|
||||
|
||||
return column;
|
||||
|
||||
Reference in New Issue
Block a user