use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest_ifnull_2 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(//
provider.checkValid("SELECT * FROM T WHERE FID = ? OR IFNULL(CAST(CURRENT_USER() AS CHAR))"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest_sqlmap method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setSchemaCheck(true);
Assert.assertFalse(//
provider.checkValid("SELECT email, passwd, login_id, full_name" + " FROM members" + " 'W'=UPPER(MID(@@version_compile_os,1,1))"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version"));
Assert.assertEquals(0, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true_1.
public void test_true_1() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version FROM DUAL"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true_2.
public void test_true_2() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version FROM X"));
Assert.assertEquals(1, provider.getTableStats().size());
}
Aggregations