Package com.alibaba.druid.sql.parser

Examples of com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList()


    public void test_3() throws Exception {
        String sql = "SELECT NOT 10;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT NOT 10;", text);
    }
View Full Code Here


    public void test_4() throws Exception {
        String sql = "SELECT NOT 0;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT NOT 0;", text);
    }
View Full Code Here

    public void test_5() throws Exception {
        String sql = "SELECT NOT NULL;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT NOT NULL;", text);
    }
View Full Code Here

    public void test_6() throws Exception {
        String sql = "SELECT ! (1+1);";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT !(1 + 1);", text);
    }
View Full Code Here

    public void test_7() throws Exception {
        String sql = "SELECT ! 1+1;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT !1 + 1;", text);
    }
View Full Code Here

    public void test_8() throws Exception {
        String sql = "SELECT 1 && 1;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 1\n\tAND 1;", text);
    }
View Full Code Here

    public void test_9() throws Exception {
        String sql = "SELECT 1 AND NULL;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 1\n\tAND NULL;", text);
    }
View Full Code Here

    public void test_10() throws Exception {
        String sql = "SELECT 0 OR NULL;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 0\n\tOR NULL;", text);
    }
View Full Code Here

    public void test_11() throws Exception {
        String sql = "SELECT 0 || NULL;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 0\n\tOR NULL;", text);
    }
View Full Code Here

    public void test_12() throws Exception {
        String sql = "SELECT 0 XOR NULL;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 0 XOR NULL;", text);
    }
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.