improve wall filter

This commit is contained in:
wenshao
2013-04-01 23:06:50 +08:00
parent 6ff2bb6a5e
commit 5f689f7aa5
10 changed files with 35 additions and 21 deletions
@@ -14,7 +14,7 @@ import com.alibaba.druid.wall.spi.SQLServerWallProvider;
public class WallStatTest_delete extends TestCase {
private String sql = "delete from t where fid = ?";
private String sql = "delete from T where fid = ?";
protected void setUp() throws Exception {
WallContext.clearContext();
@@ -29,8 +29,8 @@ import com.alibaba.druid.wall.WallUtils;
public class WallUnionTest3 extends TestCase {
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql("SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x'"));
Assert.assertFalse(WallUtils.isValidateMySql("SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x';"));
// Assert.assertFalse(WallUtils.isValidateMySql("SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x'"));
// Assert.assertFalse(WallUtils.isValidateMySql("SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x';"));
Assert.assertFalse(WallUtils.isValidateMySql("SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x'/*,10 ;"));
}
}
@@ -23,9 +23,9 @@ import java.util.concurrent.atomic.AtomicLong;
import javax.sql.DataSource;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Assert;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.alibaba.druid.filter.FilterAdapter;
@@ -20,11 +20,11 @@ import java.sql.Statement;
import javax.sql.DataSource;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.junit.Assert;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.alibaba.druid.spring.User;