Package com.alibaba.druid.sql.parser

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


    public void test_13() throws Exception {
        String sql = "SELECT 1 XOR 1 XOR 1;";

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

        String text = output(stmtList);

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


    public void test_47() throws Exception {
        String sql = "SELECT TO_DAYS('2007-10-07');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT TO_DAYS('2007-10-07');", text);
    }
View Full Code Here

    public void test_48() throws Exception {
        String sql = "SELECT TO_DAYS(950501);";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT TO_DAYS(950501);", text);
    }
View Full Code Here

    public void test_49() throws Exception {
        String sql = "SELECT TO_DAYS('0000-01-01');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT TO_DAYS('0000-01-01');", text);
    }
View Full Code Here

    public void test_50() throws Exception {
        String sql = "SELECT UNIX_TIMESTAMP();";

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

        String text = output(stmtList);

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

    public void test_51() throws Exception {
        String sql = "SELECT WEEK('2008-02-20');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT WEEK('2008-02-20');", text);
    }
View Full Code Here

    public void test_52() throws Exception {
        String sql = "SELECT MID(YEARWEEK('2000-01-01'),5,2);";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT MID(YEARWEEK('2000-01-01'), 5, 2);", text);
    }
View Full Code Here

    public void test_53() throws Exception {
        String sql = "SELECT YEARWEEK('1987-01-01');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT YEARWEEK('1987-01-01');", text);
    }
View Full Code Here

    public void test_0() throws Exception {
        String sql = "INSERT INTO t VALUES (1,AES_ENCRYPT('text','password'))";

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

        String text = output(stmtList);

        Assert.assertEquals("INSERT INTO t\nVALUES (1, AES_ENCRYPT('text', 'password'));", text);
    }
View Full Code Here

    public void test_1() throws Exception {
        String sql = "SELECT LENGTH(COMPRESS(REPEAT('a',1000)))";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT LENGTH(COMPRESS(REPEAT('a', 1000)));", 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.