use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_slaveHosts.
public void test_show_slaveHosts() throws Exception {
String sql = "SHOW SLAVE HOSTS";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowSlaveHostsStatement show = (MySqlShowSlaveHostsStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW SLAVE HOSTS", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_procedure_status_2.
public void test_show_procedure_status_2() throws Exception {
String sql = "SHOW procedure status ";
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", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_engine.
public void test_show_engine() throws Exception {
String sql = "SHOW ENGINE INNODB STATUS";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowEngineStatement show = (MySqlShowEngineStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW ENGINE INNODB STATUS", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_key.
public void test_show_key() throws Exception {
String sql = "SHOW keys from tb1 from 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_open_tables_1.
public void test_open_tables_1() throws Exception {
String sql = "SHOW OPEN TABLES FROM mysql";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW OPEN TABLES FROM mysql", output);
}
Aggregations