mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -722,6 +722,24 @@ public abstract class WallProvider {
|
||||
}
|
||||
|
||||
private WallCheckResult checkWhiteAndBlackList(String sql) {
|
||||
// check black list
|
||||
if (blackListEnable) {
|
||||
WallSqlStat sqlStat = getBlackSql(sql);
|
||||
if (sqlStat != null) {
|
||||
blackListHitCount.incrementAndGet();
|
||||
violationCount.incrementAndGet();
|
||||
|
||||
if (sqlStat.isSyntaxError()) {
|
||||
syntaxErrrorCount.incrementAndGet();
|
||||
}
|
||||
|
||||
sqlStat.incrementAndGetExecuteCount();
|
||||
recordStats(sqlStat.getTableStats(), sqlStat.getFunctionStats());
|
||||
|
||||
return new WallCheckResult(sqlStat);
|
||||
}
|
||||
}
|
||||
|
||||
if (whiteListEnable) {
|
||||
WallSqlStat sqlStat = getWhiteSql(sql);
|
||||
if (sqlStat != null) {
|
||||
@@ -740,23 +758,6 @@ public abstract class WallProvider {
|
||||
return new WallCheckResult(sqlStat);
|
||||
}
|
||||
}
|
||||
// check black list
|
||||
if (blackListEnable) {
|
||||
WallSqlStat sqlStat = getBlackSql(sql);
|
||||
if (sqlStat != null) {
|
||||
blackListHitCount.incrementAndGet();
|
||||
violationCount.incrementAndGet();
|
||||
|
||||
if (sqlStat.isSyntaxError()) {
|
||||
syntaxErrrorCount.incrementAndGet();
|
||||
}
|
||||
|
||||
sqlStat.incrementAndGetExecuteCount();
|
||||
recordStats(sqlStat.getTableStats(), sqlStat.getFunctionStats());
|
||||
|
||||
return new WallCheckResult(sqlStat);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user