use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest71 method test_false1.
public void test_false1() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(true);
Assert.assertFalse(//
provider.checkValid("select * from order_return where return_goods_money =0.00 ,return_other_money = 8--149.00, return_total_fee = ifnull(return_shipping,0)+ifnull(return_other_discount,0)+0.00--149.00-0.00,return_goods_amount=1,return_real_money=0.00"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest72 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(true);
Assert.assertFalse(//
provider.checkValid("select * from t /**/ where fid = 123 AND 1=1"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest73 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(true);
Assert.assertTrue(//
provider.checkValid(//
"DELETE FROM D1 USING PCHS_DETAIL D1 " + //
" INNER JOIN (" + //
" SELECT D.DETAIL_UID " + //
" FROM PCHS_DETAIL D " + //
" INNER JOIN PCHS_BILL B ON D.BILL_UID=B.BILL_UID " + //
" WHERE B.COM_UID='0892E8A38EF83AB6B9E25C25D8085486' " + //
" LIMIT 1000 " + " ) D2 ON D1.DETAIL_UID=D2.DETAIL_UID"));
Assert.assertEquals(3, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest_ifnull_1 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(//
provider.checkValid("SELECT * FROM T WHERE FID = ? OR ISNULL(1) = 0"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider 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());
}
Aggregations