Examples of checkValid()


Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

    public void test_true() throws Exception {
        WallProvider provider = new MySqlWallProvider();

        provider.getConfig().setSelectHavingAlwayTrueCheck(true);

        Assert.assertTrue(provider.checkValid(//
        "select * from (select t10006_men_xing_jia_ge_fen_lei.bian_hao as \"bian_hao\", " + //
                "   t10006_men_xing_jia_ge_fen_lei.ming_cheng as \"ming_cheng\" " + //
                "from t10006_men_xing_jia_ge_fen_lei where 1=1 ) as tables where 1=1 order by tables.bian_hao"));

        Assert.assertEquals(1, provider.getTableStats().size());
View Full Code Here

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

    public void test_true() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setSchemaCheck(true);

        Assert.assertTrue(provider.checkValid(//
        "show create table `mysql`.`help_relation`"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

        // 预热
        WallProvider provider = new MySqlWallProvider();
        provider.setBlackListEnable(false);
        provider.setWhiteListEnable(false);
        for (int i = 0; i < 1000 * 100; i++) {
            provider.checkValid("select sum(payment_ft) from order_goods where order_id=1 AND (SELECT 4552 FROM(SELECT COUNT(*),CONCAT(CHAR(58,107,98,119,58),(SELECT (CASE WHEN (4552=4552) THEN 1 ELSE 0 END)),CHAR(58,98,105,101,58),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)");
        }
    }

    public void test_1() throws Exception {
        String sql = "SELECT plaza_id,plaza_name,plaza_logo,plaza_address,plaza_averageMoney,plaza_discount,2*ASIN(SQRT(POW(SIN(PI()*(22.54605355-plaza_latitude)/360),2)+COS(PI()*22.54605355/180)*COS(plaza_latitude*PI()/180)*POW(SIN(PI()*(114.02597366-plaza_longitude)/360),2)))*6378.137*1000 as jl FROM plaza where 2*ASIN(SQRT(POW(SIN(PI()*(22.54605355-plaza_latitude)/360),2)+COS(PI()*22.54605355/180)*COS(plaza_latitude*PI()/180)*POW(SIN(PI()*(114.02597366-plaza_longitude)/360),2)))*6378.137*1000<= 5000 and plaza_check=2 ORDER BY jl ASC";
View Full Code Here

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

public class MySqlWallTest55 extends TestCase {

    public void test_true() throws Exception {
        WallProvider provider = new MySqlWallProvider();

        Assert.assertTrue(provider.checkValid(//
        "SELECT USER()"));

        Assert.assertEquals(0, provider.getTableStats().size());
    }
   
View Full Code Here

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

    }
   
    public void test_true_1() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
                "SELECT USER() FROM DUAL"));
       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
   
View Full Code Here

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider.checkValid()

    }
   
    public void test_true_2() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
                "SELECT USER() FROM X"));
       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
   
View Full Code Here

Examples of com.alibaba.druid.wall.spi.OracleWallProvider.checkValid()

        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql) {
        OracleWallProvider provider = new OracleWallProvider();
        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql, WallConfig config) {
        OracleWallProvider provider = new OracleWallProvider(config);
        return provider.checkValid(sql);
View Full Code Here

Examples of com.alibaba.druid.wall.spi.OracleWallProvider.checkValid()

        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql, WallConfig config) {
        OracleWallProvider provider = new OracleWallProvider(config);
        return provider.checkValid(sql);
    }
   
    public static boolean isValidateSqlServer(String sql) {
        SQLServerWallProvider provider = new SQLServerWallProvider();
        return provider.checkValid(sql);
View Full Code Here

Examples of com.alibaba.druid.wall.spi.OracleWallProvider.checkValid()

        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql) {
        OracleWallProvider provider = new OracleWallProvider();
        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql, WallConfig config) {
        OracleWallProvider provider = new OracleWallProvider(config);
        return provider.checkValid(sql);
View Full Code Here

Examples of com.alibaba.druid.wall.spi.OracleWallProvider.checkValid()

        return provider.checkValid(sql);
    }

    public static boolean isValidateOracle(String sql, WallConfig config) {
        OracleWallProvider provider = new OracleWallProvider(config);
        return provider.checkValid(sql);
    }
   
    public static boolean isValidateSqlServer(String sql) {
        SQLServerWallProvider provider = new SQLServerWallProvider();
        return provider.checkValid(sql);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.