mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for oracle sql parser schemastat visitor
This commit is contained in:
@@ -512,7 +512,11 @@ public class OracleExprParser extends SQLExprParser {
|
||||
if (lexer.token() != Token.FROM) {
|
||||
SQLExpr trim_character = this.primary();
|
||||
trim_character.setParent(methodExpr);
|
||||
methodExpr.putAttribute("trim_character", trim_character);
|
||||
if (trim_character instanceof SQLCharExpr) {
|
||||
methodExpr.putAttribute("trim_character", trim_character);
|
||||
} else {
|
||||
methodExpr.getParameters().add(trim_character);
|
||||
}
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.FROM) {
|
||||
|
||||
+1
-13
@@ -498,19 +498,7 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleSelectJoin x) {
|
||||
x.getLeft().accept(this);
|
||||
x.getRight().accept(this);
|
||||
|
||||
{
|
||||
String leftTable = (String) x.getLeft().getAttribute(ATTR_TABLE);
|
||||
String rightTable = (String) x.getRight().getAttribute(ATTR_TABLE);
|
||||
if (leftTable != null && leftTable.equals(rightTable)) {
|
||||
x.putAttribute(ATTR_TABLE, leftTable);
|
||||
}
|
||||
}
|
||||
if (x.getCondition() != null) {
|
||||
x.getCondition().accept(this);
|
||||
}
|
||||
super.visit(x);
|
||||
|
||||
for (SQLExpr item : x.getUsing()) {
|
||||
if (item instanceof SQLIdentifierExpr) {
|
||||
|
||||
@@ -736,8 +736,9 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
public boolean visit(SQLJoinTableSource x) {
|
||||
x.getLeft().accept(this);
|
||||
x.getRight().accept(this);
|
||||
if (x.getCondition() != null) {
|
||||
x.getCondition().accept(this);
|
||||
SQLExpr condition = x.getCondition();
|
||||
if (condition != null) {
|
||||
condition.accept(this);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user