use of com.alibaba.druid.wall.WallTableStat in project druid by alibaba.
the class WallStatTest_alter_table method testOracle.
public void testOracle() throws Exception {
String sql = "alter table t add (fname varchar(50))";
WallProvider provider = new OracleWallProvider();
provider.getConfig().setAlterTableAllow(true);
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getAlterCount());
}
use of com.alibaba.druid.wall.WallTableStat in project druid by alibaba.
the class WallStatTest_select_into method testMySql.
public void testMySql() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(provider.checkValid(sql));
{
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getSelectCount());
Assert.assertEquals(0, tableStat.getSelectIntoCount());
}
{
WallTableStat tableStat = provider.getTableStat("x");
Assert.assertEquals(0, tableStat.getSelectCount());
Assert.assertEquals(1, tableStat.getSelectIntoCount());
}
}
use of com.alibaba.druid.wall.WallTableStat in project druid by alibaba.
the class WallStatTest_select_into method testSQLServer.
public void testSQLServer() throws Exception {
WallProvider provider = new SQLServerWallProvider();
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getSelectCount());
}
use of com.alibaba.druid.wall.WallTableStat in project druid by alibaba.
the class WallStatTest_update method testOracle.
public void testOracle() throws Exception {
WallProvider provider = new OracleWallProvider();
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getUpdateCount());
}
use of com.alibaba.druid.wall.WallTableStat in project druid by alibaba.
the class WallStatTest_update method testPG.
public void testPG() throws Exception {
WallProvider provider = new PGWallProvider();
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getUpdateCount());
}
Aggregations