bug fixed for SchemaStat for Hierarchical Query pseudocolumn.

This commit is contained in:
wenshao
2017-04-24 19:05:14 +08:00
parent 7b998a45ff
commit e3a868ec4f
2 changed files with 66 additions and 5 deletions
@@ -968,14 +968,13 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
}
if ("LEVEL".equalsIgnoreCase(ident) || "CONNECT_BY_ISCYCLE".equalsIgnoreCase(ident)) {
SQLObject parent = x.getParent();
if (parent instanceof SQLSelectItem) {
SQLObject parent2 = parent.getParent();
if (parent2 instanceof SQLSelectQueryBlock) {
SQLSelectQueryBlock queryBlock = (SQLSelectQueryBlock) parent2;
for (SQLObject parent = x.getParent(); parent != null; parent = parent.getParent()) {
if (parent instanceof SQLSelectQueryBlock) {
SQLSelectQueryBlock queryBlock = (SQLSelectQueryBlock) parent;
if (queryBlock.getStartWith() != null || queryBlock.getConnectBy() != null) {
return false;
}
break;
}
}
}