Search in sources :

Example 6 with MySqlShowGrantsStatement

use of com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement in project druid by alibaba.

the class DALParserTest method test_show_grants_3.

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);
}
Also used : MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser) MySqlShowGrantsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement)

Example 7 with MySqlShowGrantsStatement

use of com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement in project druid by alibaba.

the class DALParserTest method test_show_grants_1.

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);
}
Also used : MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser) MySqlShowGrantsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement)

Aggregations

MySqlShowGrantsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement)7 CobarShowStatus (com.alibaba.druid.sql.dialect.mysql.ast.statement.CobarShowStatus)2 MySqlShowAuthorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowAuthorsStatement)2 MySqlShowBinLogEventsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinLogEventsStatement)2 MySqlShowBinaryLogsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinaryLogsStatement)2 MySqlShowCharacterSetStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCharacterSetStatement)2 MySqlShowCollationStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCollationStatement)2 MySqlShowColumnsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowColumnsStatement)2 MySqlShowContributorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowContributorsStatement)2 MySqlShowCreateDatabaseStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateDatabaseStatement)2 MySqlShowCreateEventStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateEventStatement)2 MySqlShowCreateFunctionStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateFunctionStatement)2 MySqlShowCreateProcedureStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateProcedureStatement)2 MySqlShowCreateTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTableStatement)2 MySqlShowCreateTriggerStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement)2 MySqlShowCreateViewStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateViewStatement)2 MySqlShowDatabasesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowDatabasesStatement)2 MySqlShowEngineStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement)2 MySqlShowEnginesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement)2 MySqlShowErrorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement)2