mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fix for WallFilter setLimit, fix #2649
This commit is contained in:
@@ -34,6 +34,7 @@ import com.alibaba.druid.DbType;
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLUpdateStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlHintStatement;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
@@ -708,7 +709,19 @@ public abstract class WallProvider {
|
||||
}
|
||||
} else {
|
||||
if ((!updateCheckHandlerEnable) && sql.length() < MAX_SQL_LENGTH) {
|
||||
sqlStat = addWhiteSql(sql, tableStat, context.getFunctionStats(), syntaxError);
|
||||
boolean selectLimit = false;
|
||||
if (config.getSelectLimit() > 0) {
|
||||
for (SQLStatement stmt : statementList) {
|
||||
if (stmt instanceof SQLSelectStatement) {
|
||||
selectLimit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!selectLimit) {
|
||||
sqlStat = addWhiteSql(sql, tableStat, context.getFunctionStats(), syntaxError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user