mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for wall-filter. for issue #2167
This commit is contained in:
@@ -1975,7 +1975,7 @@ public class SQLExprParser extends SQLParser {
|
||||
|
||||
for (;;) {
|
||||
lexer.nextToken();
|
||||
SQLExpr more = relational();
|
||||
SQLExpr more = and();
|
||||
group.add(more);
|
||||
if (lexer.token == Token.OR) {
|
||||
if (lexer.isKeepComments() && lexer.hasComment()) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.alibaba.druid.bvt.filter.wall.mysql;
|
||||
|
||||
import com.alibaba.druid.wall.WallProvider;
|
||||
import com.alibaba.druid.wall.spi.MySqlWallProvider;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class MySqlWallTest148 extends TestCase {
|
||||
|
||||
public void test_false() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
|
||||
String sql = "select * from TABLENAME cfgdatasou0_ where cfgdatasou0_.type=? and cfgdatasou0_.module_name=? and cfgdatasou0_.node_type=? or cfgdatasou0_.type=? and cfgdatasou0_.module_name=? and cfgdatasou0_.node_type=? or cfgdatasou0_.type=? and cfgdatasou0_.module_name=? and cfgdatasou0_.node_type=?";
|
||||
|
||||
Assert.assertTrue(
|
||||
provider.checkValid(sql)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user