mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved oracle sql parser.
This commit is contained in:
@@ -797,6 +797,16 @@ public class OracleExprParser extends SQLExprParser {
|
||||
}
|
||||
|
||||
accept(Token.RPAREN);
|
||||
|
||||
if (lexer.stringVal().equalsIgnoreCase("IGNORE")) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("NULLS");
|
||||
aggregateExpr.setIgnoreNulls(true);
|
||||
} else if (lexer.identifierEquals(FnvHash.Constants.RESPECT)) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("NULLS");
|
||||
aggregateExpr.setIgnoreNulls(false);
|
||||
}
|
||||
|
||||
if (lexer.identifierEquals(FnvHash.Constants.WITHIN)) {
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -2058,6 +2058,10 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
|
||||
print(')');
|
||||
|
||||
if (x.isIgnoreNulls()) {
|
||||
print0(ucase ? " IGNORE NULLS" : " ignore nulls");
|
||||
}
|
||||
|
||||
SQLKeep keep = x.getKeep();
|
||||
if (keep != null) {
|
||||
print(' ');
|
||||
|
||||
@@ -2819,6 +2819,10 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
protected final void statExpr(SQLExpr x) {
|
||||
if (x == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Class<?> clazz = x.getClass();
|
||||
if (clazz == SQLIdentifierExpr.class) {
|
||||
visit((SQLIdentifierExpr) x);
|
||||
|
||||
Reference in New Issue
Block a user