This commit is contained in:
温少
2012-03-17 15:20:46 +08:00
parent e9c064413a
commit 946e43db53
2 changed files with 14 additions and 2 deletions
@@ -11,6 +11,7 @@ public class WallConfig {
private boolean selelctAllow = true;
private boolean selectIntoAllow = true;
private boolean selectIntoOutfileAllow = false;
private boolean selectWhereAlwayTrueCheck = true;
private boolean selectHavingAlwayTrueCheck = true;
@@ -90,6 +91,14 @@ public class WallConfig {
this.selectIntoAllow = selectIntoAllow;
}
public boolean isSelectIntoOutfileAllow() {
return selectIntoOutfileAllow;
}
public void setSelectIntoOutfileAllow(boolean selectIntoOutfileAllow) {
this.selectIntoOutfileAllow = selectIntoOutfileAllow;
}
public boolean isSelectWhereAlwayTrueCheck() {
return selectWhereAlwayTrueCheck;
}
@@ -167,8 +167,11 @@ public class MySqlWallVisitor extends MySqlASTVisitorAdapter implements WallVisi
@Override
public boolean visit(MySqlOutFileExpr x) {
violations.add(new IllegalSQLObjectViolation(SQLUtils.toMySqlString(x)));
return false;
if (!config.isSelectIntoOutfileAllow()) {
violations.add(new IllegalSQLObjectViolation(SQLUtils.toMySqlString(x)));
}
return true;
}
@Override