mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user