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

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


    public void test_27() throws Exception {
        String sql = "SELECT INTERVAL 31 DAY;";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT INTERVAL 31 DAY;", text);
    }
View Full Code Here


    public void test_28() throws Exception {
        String sql = "SELECT INTERVAL '1.999999' SECOND_MICROSECOND;";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT INTERVAL '1.999999' SECOND_MICROSECOND;", text);
    }
View Full Code Here

    public void test_29() throws Exception {
        String sql = "SELECT '2005-03-32' + INTERVAL 1 MONTH;";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT '2005-03-32' + INTERVAL 1 MONTH;", text);
    }
View Full Code Here

    public void test_30() throws Exception {
        String sql = "SELECT DATE_FORMAT('2009-10-04 22:23:00', '%W %M %Y');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT DATE_FORMAT('2009-10-04 22:23:00', '%W %M %Y');", text);
    }
View Full Code Here

    public void test_31() throws Exception {
        String sql = "SELECT EXTRACT(YEAR FROM '2009-07-02');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT EXTRACT(YEAR FROM '2009-07-02');", text);
    }
View Full Code Here

    public void test_32() throws Exception {
        String sql = "SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');", text);
    }
View Full Code Here

    public void test_33() throws Exception {
        String sql = "SELECT EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03');", text);
    }
View Full Code Here

    public void test_34() throws Exception {
        String sql = "SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.000123');";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.000123');", text);
    }
View Full Code Here

    public void test_35() throws Exception {
        String sql = "SELECT FROM_UNIXTIME(1196440219);";

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

        String text = output(stmtList);

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

    public void test_36() throws Exception {
        String sql = "SELECT FROM_UNIXTIME(1196440219) + 0;";

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

        String text = output(stmtList);

        Assert.assertEquals("SELECT FROM_UNIXTIME(1196440219) + 0;", 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.