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);
}
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);
}
Aggregations