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

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


   
    public void test_show_create_database() throws Exception {
        String sql = "SHOW CREATE DATABASE db_name";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateDatabaseStatement show = (MySqlShowCreateDatabaseStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE DATABASE db_name", output);
    }
   
    public void test_show_create_event() throws Exception {
View Full Code Here


   
    public void test_show_create_event() throws Exception {
        String sql = "SHOW CREATE event db_name";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateEventStatement show = (MySqlShowCreateEventStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE EVENT db_name", output);
    }
   
    public void test_show_create_function() throws Exception {
View Full Code Here

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

   
    public void test_show_create_PROCEDURE() throws Exception {
        String sql = "SHOW CREATE PROCEDURE x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateProcedureStatement show = (MySqlShowCreateProcedureStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE PROCEDURE x", output);
    }
   
    public void test_show_create_table() throws Exception {
View Full Code Here

   
    public void test_show_create_table() throws Exception {
        String sql = "SHOW CREATE table x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateTableStatement show = (MySqlShowCreateTableStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE TABLE x", output);
    }
   
    public void test_show_create_trigger() throws Exception {
View Full Code Here

   
    public void test_show_create_trigger() throws Exception {
        String sql = "SHOW CREATE trigger x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateTriggerStatement show = (MySqlShowCreateTriggerStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE TRIGGER x", output);
    }
   
    public void test_show_create_view() throws Exception {
View Full Code Here

   
    public void test_show_create_view() throws Exception {
        String sql = "SHOW CREATE VIEW x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowCreateViewStatement show = (MySqlShowCreateViewStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW CREATE VIEW x", output);
    }
   
    public void test_show_databases() throws Exception {
View Full Code Here

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

   
    public void test_show_databases_1() throws Exception {
        String sql = "SHOW DATABASES LIKE 'a%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowDatabasesStatement show = (MySqlShowDatabasesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW DATABASES LIKE 'a%'", output);
    }
   
    public void test_show_databases_2() throws Exception {
View Full Code Here

   
    public void test_show_databases_2() throws Exception {
        String sql = "SHOW DATABASES WHERE `Database` = 'mysql'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);   
        MySqlShowDatabasesStatement show = (MySqlShowDatabasesStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW DATABASES WHERE `Database` = 'mysql'", output);
    }
   
    public void test_show_engine() 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.