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

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


    public void test_7() throws Exception {
        String sql = "SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002')";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002');", text);
    }
View Full Code Here


    public void test_8() throws Exception {
        String sql = "SELECT ADDTIME('01:00:00.999999', '02:00:00.999998')";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT ADDTIME('01:00:00.999999', '02:00:00.999998');", text);
    }
View Full Code Here

    public void test_9() throws Exception {
        String sql = "SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT CONVERT_TZ('2004-01-01 12:00:00', 'GMT', 'MET');", text);
    }
View Full Code Here

    public void test_10() throws Exception {
        String sql = "SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT CONVERT_TZ('2004-01-01 12:00:00', '+00:00', '+10:00');", text);
    }
View Full Code Here

    public void test_11() throws Exception {
        String sql = "SELECT CURDATE();";

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

        String text = output(stmtList);

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

    public void test_12() throws Exception {
        String sql = "SELECT CURDATE() + 0;";

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

        String text = output(stmtList);

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

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

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

        String text = output(stmtList);

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

    public void test_14() throws Exception {
        String sql = "SELECT CURDATE() + 0;";

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

        String text = output(stmtList);

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

    public void test_15() throws Exception {
        String sql = "SELECT DATE('2003-12-31 01:02:03');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT DATE('2003-12-31 01:02:03');", text);
    }
View Full Code Here

    public void test_16() throws Exception {
        String sql = "SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT DATEDIFF('2007-12-31 23:59:59', '2007-12-30');", 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.