bug fix for sql wall

This commit is contained in:
高铁
2019-09-15 22:03:59 +08:00
parent 1d784d12bd
commit c12a2b52c4
7 changed files with 63 additions and 6 deletions
@@ -0,0 +1,48 @@
package com.alibaba.druid.bvt.filter.wall;
import com.alibaba.druid.wall.WallContext;
import com.alibaba.druid.wall.WallProvider;
import com.alibaba.druid.wall.spi.MySqlWallProvider;
import com.alibaba.druid.wall.spi.OracleWallProvider;
import com.alibaba.druid.wall.spi.PGWallProvider;
import com.alibaba.druid.wall.spi.SQLServerWallProvider;
import junit.framework.TestCase;
public class WallStatTest_select_2
extends TestCase {
private String sql = "SELECT *\n" +
"FROM `t`\n" +
"WHERE `t`.`col1` = '1'\n" +
" AND `t`.`col2` = 0\n" +
" AND CONCAT(t.col3, '_', t.col4) IN ('abc_def')";
protected void setUp() throws Exception {
WallContext.clearContext();
}
protected void tearDown() throws Exception {
WallContext.clearContext();
}
public void testMySql() throws Exception {
WallProvider provider = new MySqlWallProvider();
assertTrue(provider.checkValid(sql));
}
public void testOracle() throws Exception {
WallProvider provider = new OracleWallProvider();
assertTrue(provider.checkValid(sql));
}
public void testPG() throws Exception {
WallProvider provider = new PGWallProvider();
assertTrue(provider.checkValid(sql));
}
public void testSQLServer() throws Exception {
WallProvider provider = new SQLServerWallProvider();
assertTrue(provider.checkValid(sql));
}
}