bug fixed for schema stat

This commit is contained in:
温少
2012-03-18 12:24:40 +08:00
13 changed files with 105 additions and 83 deletions
@@ -472,9 +472,16 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
x.getFrom().accept(this);
return false;
}
if (x.getInto() != null) {
SQLName into = (SQLName) x.getInto().getExpr();
String ident = into.toString();
TableStat stat = getTableStat(ident);
stat.incrementInsertCount();
}
String originalTable = getCurrentTable();
if (x.getFrom() instanceof SQLExprTableSource) {
SQLExprTableSource tableSource = (SQLExprTableSource) x.getFrom();
if (tableSource.getExpr() instanceof SQLName) {
@@ -488,7 +495,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
x.putAttribute("_old_local_", originalTable);
}
}
if (x.getFrom() != null) {
x.getFrom().accept(this); // 提前执行,获得aliasMap
String table = (String) x.getFrom().getAttribute(ATTR_TABLE);