bug fixed for SchemaStatVisitor

This commit is contained in:
高铁
2015-10-18 23:38:11 +08:00
parent 12bef9bb54
commit 05cc064507
@@ -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;
}