Search in sources :

Example 21 with SQLServerWallProvider

use of com.alibaba.druid.wall.spi.SQLServerWallProvider in project druid by alibaba.

the class SQLServerWallTest_8 method test_true.

public void test_true() throws Exception {
    WallProvider provider = new SQLServerWallProvider();
    provider.getConfig().setMustParameterized(true);
    Assert.assertFalse(provider.checkValid("select * from t where fid = 1"));
}
Also used : WallProvider(com.alibaba.druid.wall.WallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Example 22 with SQLServerWallProvider

use of com.alibaba.druid.wall.spi.SQLServerWallProvider in project druid by alibaba.

the class SQLServerWallTest_3 method test_true.

public void test_true() throws Exception {
    WallProvider provider = new SQLServerWallProvider();
    provider.getConfig().setSelectHavingAlwayTrueCheck(true);
    Assert.assertFalse(// 
    provider.checkValid("select * from t where LEN(HOST_NAME()) > 0"));
    Assert.assertEquals(1, provider.getTableStats().size());
    Assert.assertTrue(provider.getTableStats().containsKey("t"));
}
Also used : WallProvider(com.alibaba.druid.wall.WallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Aggregations

SQLServerWallProvider (com.alibaba.druid.wall.spi.SQLServerWallProvider)22 WallProvider (com.alibaba.druid.wall.WallProvider)21 MySqlWallProvider (com.alibaba.druid.wall.spi.MySqlWallProvider)10 OracleWallProvider (com.alibaba.druid.wall.spi.OracleWallProvider)9 PGWallProvider (com.alibaba.druid.wall.spi.PGWallProvider)9 WallTableStat (com.alibaba.druid.wall.WallTableStat)8