mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for SchemaStatVisitor
This commit is contained in:
@@ -793,6 +793,22 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isParentSelectItem(SQLObject parent) {
|
||||
if (parent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parent instanceof SQLSelectItem) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parent instanceof SQLSelectQueryBlock) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isParentSelectItem(parent.getParent());
|
||||
}
|
||||
|
||||
private void setColumn(SQLExpr x, Column column) {
|
||||
SQLObject current = x;
|
||||
@@ -821,7 +837,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
break;
|
||||
}
|
||||
|
||||
if (parent instanceof SQLSelectItem) {
|
||||
if (isParentSelectItem(parent)) {
|
||||
column.setSelec(true);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user