use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class Issue_728 method test1.
public void test1() throws Exception {
String sql = "select * from city_list where city_id = 3-1";
WallConfig config = new WallConfig();
config.setConstArithmeticAllow(false);
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class Issue_728 method test2.
public void test2() throws Exception {
String sql = "SELECT * from city_list where 2 = case when 2=1 then 1 else 2 END";
WallConfig config = new WallConfig();
config.setCaseConditionConstAllow(false);
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class BitwiseAndTest method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setConditionOpBitwseAllow(false);
Assert.assertFalse(//
WallUtils.isValidateMySql("SELECT * from t where (id = 1) & 2", //
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class BitwiseOrTest method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setConditionOpBitwseAllow(false);
Assert.assertFalse(//
WallUtils.isValidateMySql("SELECT * from t where (id = 1) | 2", //
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class BitwiseXorTest method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setConditionOpBitwseAllow(false);
Assert.assertFalse(//
WallUtils.isValidateMySql("SELECT * from t where (id = 1) ^ (1=1)", //
config));
}
Aggregations