mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -885,6 +885,8 @@ public class OracleExprParser extends SQLExprParser {
|
||||
interval.setValue(new SQLCharExpr(lexer.stringVal()));
|
||||
} else if (lexer.token() == Token.VARIANT) {
|
||||
interval.setValue(new SQLVariantRefExpr(lexer.stringVal()));
|
||||
} else if (lexer.token() == Token.QUES) {
|
||||
interval.setValue(new SQLVariantRefExpr("?"));
|
||||
} else {
|
||||
return new SQLIdentifierExpr("INTERVAL");
|
||||
}
|
||||
|
||||
@@ -179,7 +179,8 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
}
|
||||
|
||||
public boolean visit(OracleIntervalExpr x) {
|
||||
if (x.getValue() instanceof SQLLiteralExpr) {
|
||||
SQLExpr value = x.getValue();
|
||||
if (value instanceof SQLLiteralExpr || value instanceof SQLVariantRefExpr) {
|
||||
print0(ucase ? "INTERVAL " : "interval ");
|
||||
x.getValue().accept(this);
|
||||
print(' ');
|
||||
|
||||
Reference in New Issue
Block a user