sql wall support

This commit is contained in:
温少
2012-03-16 22:14:39 +08:00
6 changed files with 81 additions and 19 deletions
@@ -15,10 +15,10 @@ public class WallSelectWhereTest extends TestCase {
private String sql = "SELECT F1, F2 WHERE 1 = 1";
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql));
Assert.assertTrue(WallUtils.isValidateMySql(sql));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql));
Assert.assertTrue(WallUtils.isValidateOracle(sql));
}
}
@@ -0,0 +1,24 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.filter.wall.WallUtils;
/**
* 这个场景,检测可疑的Having条件
* @author wenshao
*
*/
public class WallSelectWhereTest0 extends TestCase {
private String sql = "SELECT F1, F2 WHERE 1 = 1 OR F1 = ?";
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql));
}
}