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

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


   
    public void test_show_index_2() throws Exception {
        String sql = "SHOW index in db.tb1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowIndexesStatement show = (MySqlShowIndexesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW INDEX FROM db.tb1", output);
    }
   
    public void test_show_key() throws Exception {
View Full Code Here


   
    public void test_show_key() throws Exception {
        String sql = "SHOW keys from tb1 from db";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowKeysStatement show = (MySqlShowKeysStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW KEYS FROM db.tb1", output);
    }
   
    public void test_show_key_1() throws Exception {
View Full Code Here

   
    public void test_show_key_1() throws Exception {
        String sql = "SHOW keys in tb1 in db";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowKeysStatement show = (MySqlShowKeysStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW KEYS FROM db.tb1", output);
    }
   
    public void test_show_key_2() throws Exception {
View Full Code Here

   
    public void test_show_key_2() throws Exception {
        String sql = "SHOW keys in db.tb1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowKeysStatement show = (MySqlShowKeysStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW KEYS FROM db.tb1", output);
    }
   
    public void test_master_status() throws Exception {
View Full Code Here

   
    public void test_master_status() throws Exception {
        String sql = "SHOW MASTER STATUS";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowMasterStatusStatement show = (MySqlShowMasterStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW MASTER STATUS", output);
    }
   
    public void test_open_tables() throws Exception {
View Full Code Here

   
    public void test_open_tables() throws Exception {
        String sql = "SHOW OPEN TABLES";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW OPEN TABLES", output);
    }
   
    public void test_open_tables_1() throws Exception {
View Full Code Here

   
    public void test_open_tables_1() throws Exception {
        String sql = "SHOW OPEN TABLES FROM mysql";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW OPEN TABLES FROM mysql", output);
    }
   
    public void test_open_tables_2() throws Exception {
View Full Code Here

   
    public void test_open_tables_2() throws Exception {
        String sql = "SHOW OPEN TABLES in mysql";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW OPEN TABLES FROM mysql", output);
    }
   
    public void test_open_tables_3() throws Exception {
View Full Code Here

   
    public void test_open_tables_3() throws Exception {
        String sql = "SHOW OPEN TABLES in mysql like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW OPEN TABLES FROM mysql LIKE '%'", output);
    }
   
    public void test_open_tables_4() throws Exception {
View Full Code Here

   
    public void test_open_tables_4() throws Exception {
        String sql = "SHOW OPEN TABLES in mysql where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW OPEN TABLES FROM mysql WHERE 1 = 1", output);
    }
   
    public void test_show_open_plugins() 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.