Search in sources :

Example 6 with MySqlShowColumnsStatement

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

the class DALParserTest method test_show_columns_2.

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

Example 7 with MySqlShowColumnsStatement

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

the class DALParserTest method test_show_columns_3.

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

Aggregations

MySqlShowColumnsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowColumnsStatement)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 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 MySqlShowEventsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement)2