mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved oracle sql parser trim option, fixed issue #1327
This commit is contained in:
@@ -508,9 +508,13 @@ public class OracleExprParser extends SQLExprParser {
|
||||
methodExpr.putAttribute("trim_option", lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
}
|
||||
SQLExpr trim_character = this.primary();
|
||||
trim_character.setParent(methodExpr);
|
||||
methodExpr.putAttribute("trim_character", trim_character);
|
||||
|
||||
if (lexer.token() != Token.FROM) {
|
||||
SQLExpr trim_character = this.primary();
|
||||
trim_character.setParent(methodExpr);
|
||||
methodExpr.putAttribute("trim_character", trim_character);
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.FROM) {
|
||||
lexer.nextToken();
|
||||
SQLExpr trim_source = this.expr();
|
||||
|
||||
@@ -480,7 +480,9 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
x.getExpr().accept(this);
|
||||
if (x.getType() != null) {
|
||||
print(' ');
|
||||
print0(x.getType().name().toUpperCase());
|
||||
|
||||
String typeName = x.getType().name();
|
||||
print0(ucase ? typeName.toUpperCase() : typeName.toLowerCase());
|
||||
}
|
||||
|
||||
if (x.getNullsOrderType() != null) {
|
||||
|
||||
Reference in New Issue
Block a user