improve wall filter

This commit is contained in:
wenshao
2013-04-07 00:14:33 +08:00
parent 707fe5214e
commit dfd6699dc4
8 changed files with 337 additions and 47 deletions
@@ -36,22 +36,26 @@ public class WallCheckResult {
this(null);
}
public WallCheckResult(WallSqlStat sqlStat){
public WallCheckResult(WallSqlStat sqlStat, List<SQLStatement> stmtList){
if (sqlStat != null) {
tableStats = sqlStat.getTableStats();
violations = sqlStat.getViolations();
functionStats = sqlStat.getFunctionStats();
statementList = Collections.emptyList();
statementList = stmtList;
syntaxError = sqlStat.isSyntaxError();
} else {
tableStats = Collections.emptyMap();
violations = Collections.emptyList();
functionStats = Collections.emptyMap();
statementList = Collections.emptyList();
statementList = stmtList;
syntaxError = false;
}
}
public WallCheckResult(WallSqlStat sqlStat){
this(sqlStat, Collections.<SQLStatement> emptyList());
}
public WallCheckResult(List<Violation> violations, Map<String, WallSqlTableStat> tableStats,
Map<String, WallSqlFunctionStat> functionStats, List<SQLStatement> statementList,
boolean syntaxError){
@@ -70,7 +74,6 @@ public class WallCheckResult {
return statementList;
}
public Map<String, WallSqlTableStat> getTableStats() {
return tableStats;
}