mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge branch 'master' of https://github.com/wenshao/druid
This commit is contained in:
@@ -31,7 +31,7 @@ public class WallConfig implements WallConfigMBean {
|
||||
private boolean selectIntoAllow = true;
|
||||
private boolean selectIntoOutfileAllow = false;
|
||||
private boolean selectWhereAlwayTrueCheck = true;
|
||||
private boolean selectHavingAlwayTrueCheck = true;
|
||||
private boolean selectHavingAlwayTrueCheck = false;
|
||||
private boolean selectUnionCheck = true;
|
||||
private boolean createTableAllow = true;
|
||||
private boolean dropTableAllow = true;
|
||||
|
||||
@@ -63,6 +63,7 @@ import com.alibaba.druid.wall.WallContext;
|
||||
import com.alibaba.druid.wall.WallProvider;
|
||||
import com.alibaba.druid.wall.WallSqlTableStat;
|
||||
import com.alibaba.druid.wall.WallVisitor;
|
||||
import com.alibaba.druid.wall.spi.WallVisitorUtils.WallConditionContext;
|
||||
import com.alibaba.druid.wall.violation.ErrorCode;
|
||||
import com.alibaba.druid.wall.violation.IllegalSQLObjectViolation;
|
||||
|
||||
@@ -255,8 +256,8 @@ public class MySqlWallVisitor extends MySqlASTVisitorAdapter implements WallVisi
|
||||
}
|
||||
|
||||
if (varName.startsWith("@@") && !checkVar(x.getParent(), x.getName())) {
|
||||
boolean isTop = WallVisitorUtils.isTopNoneFromSelect(this, x);
|
||||
if (!isTop) {
|
||||
boolean noneCondition = WallVisitorUtils.getWallConditionContext() == null;
|
||||
if (!noneCondition) {
|
||||
violations.add(new IllegalSQLObjectViolation(ErrorCode.VARIANT_DENY, "variable not allow : "
|
||||
+ x.getName(), toSQL(x)));
|
||||
}
|
||||
|
||||
@@ -678,7 +678,9 @@ public class WallVisitorUtils {
|
||||
WallContext context = WallContext.current();
|
||||
if (context != null) {
|
||||
if (current.hasPartAlwayTrue() || Boolean.TRUE == value) {
|
||||
context.incrementWarnnings();
|
||||
if (!isFirst(x)) {
|
||||
context.incrementWarnnings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user