use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest79 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(//
provider.checkValid("SELECT * FROM T WHERE FID = ? OR LEAST(2,1,9,8) = 1"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest80 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT * FROM T WHERE FID = ? OR FID LIKE 1"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest82 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setStrictSyntaxCheck(false);
Assert.assertFalse(//
provider.checkValid("SELECT * FROM T WHERE FID = '\0a' OR LEAST(2,1,9,8) = 1"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest50 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SHOW /* 113.97.255.240 */ GLOBAL VARIABLES LIKE 'ft\\_min\\_word\\_len'"));
Assert.assertEquals(0, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest51 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("REPLACE /* SearchMySQL::update Wikiadmin */ INTO `wiki_searchindex` (si_page,si_title,si_text) VALUES ('15',' u8e5858d u8e8b4a3 u8e5a3b0 u8e6988e')"));
Assert.assertEquals(1, provider.getTableStats().size());
}
Aggregations