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

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


   
    public void test_show_function_code() throws Exception {
        String sql = "SHOW function code x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionCodeStatement show = (MySqlShowFunctionCodeStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION CODE x", output);
    }
   
    public void test_show_function_status() throws Exception {
View Full Code Here


   
    public void test_show_function_status() throws Exception {
        String sql = "SHOW function status like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS LIKE '%'", output);
    }
   
    public void test_show_function_status_1() throws Exception {
View Full Code Here

   
    public void test_show_function_status_1() throws Exception {
        String sql = "SHOW function status where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS WHERE 1 = 1", output);
    }
   
    public void test_show_function_status_2() throws Exception {
View Full Code Here

   
    public void test_show_function_status_2() throws Exception {
        String sql = "SHOW function status ";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS", output);
    }
   
    public void test_show_grants() throws Exception {
View Full Code Here

   
    public void test_show_grants() throws Exception {
        String sql = "SHOW GRANTS FOR 'root'@'localhost';";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowGrantsStatement show = (MySqlShowGrantsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW GRANTS FOR 'root'@'localhost'", output);
    }
   
    public void test_show_grants_1() throws Exception {
View Full Code Here

   
    public void test_show_grants_1() throws Exception {
        String sql = "SHOW GRANTS";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowGrantsStatement show = (MySqlShowGrantsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW GRANTS", output);
    }
   
    public void test_show_grants_2() throws Exception {
View Full Code Here

   
    public void test_show_grants_2() throws Exception {
        String sql = "SHOW GRANTS FOR CURRENT_USER";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowGrantsStatement show = (MySqlShowGrantsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW GRANTS FOR CURRENT_USER", output);
    }
   
    public void test_show_grants_3() throws Exception {
View Full Code Here

   
    public void test_show_grants_3() throws Exception {
        String sql = "SHOW GRANTS FOR CURRENT_USER()";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowGrantsStatement show = (MySqlShowGrantsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW GRANTS FOR CURRENT_USER()", output);
    }
   
    public void test_show_index() throws Exception {
View Full Code Here

   
    public void test_show_index() throws Exception {
        String sql = "SHOW index from tb1 from db";
        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_index_1() throws Exception {
View Full Code Here

   
    public void test_show_index_1() throws Exception {
        String sql = "SHOW index in tb1 in db";
        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_index_2() 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.