Package com.alibaba.druid.sql.dialect.mysql.parser

Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseStatementList()


    public void test_1() throws Exception {
        String sql = "SELECT -10 IS TRUE;";

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

        String text = output(stmtList);

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


    public void test_2() throws Exception {
        String sql = "SELECT 'string' IS NOT NULL;";

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

        String text = output(stmtList);

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

    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

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.