use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_procedure_status.
public void test_show_procedure_status() throws Exception {
String sql = "SHOW procedure status like '%'";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowProcedureStatusStatement show = (MySqlShowProcedureStatusStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW PROCEDURE STATUS LIKE '%'", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_create_database.
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);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_columns_1.
public void test_show_columns_1() throws Exception {
String sql = "show columns from events where Field = 'name'";
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 events WHERE Field = 'name'", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_key_1.
public void test_show_key_1() throws Exception {
String sql = "SHOW keys in tb1 in db";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowKeysStatement show = (MySqlShowKeysStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW KEYS FROM db.tb1", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_engines.
public void test_show_engines() throws Exception {
String sql = "SHOW ENGINES";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowEnginesStatement show = (MySqlShowEnginesStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW ENGINES", output);
}
Aggregations