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

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


   
    public void test_binaryLog_1() throws Exception {
        String sql = "SHOW binlog events from 1 limit 1,2";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowBinLogEventsStatement show = (MySqlShowBinLogEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW BINLOG EVENTS FROM 1 LIMIT 1, 2", output);
    }
   
    public void test_binaryLog_2() throws Exception {
View Full Code Here


   
    public void test_binaryLog_2() throws Exception {
        String sql = "SHOW binlog events ";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowBinLogEventsStatement show = (MySqlShowBinLogEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW BINLOG EVENTS", output);
    }
   
    public void test_show_character_set() throws Exception {
View Full Code Here

   
    public void test_show_character_set() throws Exception {
        String sql = "SHOW CHARACTER SET like 'var' ";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCharacterSetStatement show = (MySqlShowCharacterSetStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CHARACTER SET LIKE 'var'", output);
    }
   
   
View Full Code Here

   
    public void test_show_character_set_1() throws Exception {
        String sql = "SHOW CHARACTER SET where Charset = 'big5'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCharacterSetStatement show = (MySqlShowCharacterSetStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CHARACTER SET WHERE Charset = 'big5'", output);
    }
   
   
View Full Code Here

   
    public void test_show_character_set_2() throws Exception {
        String sql = "SHOW CHARACTER SET";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCharacterSetStatement show = (MySqlShowCharacterSetStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CHARACTER SET", output);
    }
   
    public void test_show_columns() throws Exception {
View Full Code Here

   
    public void test_show_columns() throws Exception {
        String sql = "SHOW full columns from tb1 from db1 like 'var' ";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowColumnsStatement show = (MySqlShowColumnsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FULL COLUMNS FROM db1.tb1 LIKE 'var'", output);
    }
   
    public void test_show_columns_1() throws Exception {
View Full Code Here

   
    public void test_show_columns_1() throws Exception {
        String sql = "show columns from events where Field = 'name'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowColumnsStatement show = (MySqlShowColumnsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW COLUMNS FROM events WHERE Field = 'name'", output);
    }
   
    public void test_show_columns_2() throws Exception {
View Full Code Here

   
    public void test_show_columns_2() throws Exception {
        String sql = "SHOW COLUMNS FROM City";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowColumnsStatement show = (MySqlShowColumnsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW COLUMNS FROM City", output);
    }
   
    public void test_show_columns_3() throws Exception {
View Full Code Here

   
    public void test_show_columns_3() throws Exception {
        String sql = "SHOW full columns from db1.tb1 like 'var' ";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowColumnsStatement show = (MySqlShowColumnsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FULL COLUMNS FROM db1.tb1 LIKE 'var'", output);
    }
   
    public void test_show_contributors() throws Exception {
View Full Code Here

   
    public void test_show_contributors() throws Exception {
        String sql = "SHOW contributors";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowContributorsStatement show = (MySqlShowContributorsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CONTRIBUTORS", output);
    }
   
    public void test_show_create_database() throws Exception {
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.