use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_variants_1.
public void test_show_variants_1() throws Exception {
String sql = "SHOW GLOBAL VARIABLES LIKE '%size%';";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowVariantsStatement show = (MySqlShowVariantsStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW GLOBAL VARIABLES LIKE '%size%'", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_create_trigger.
public void test_show_create_trigger() throws Exception {
String sql = "SHOW CREATE trigger x";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowCreateTriggerStatement show = (MySqlShowCreateTriggerStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW CREATE TRIGGER x", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_create_view.
public void test_show_create_view() throws Exception {
String sql = "SHOW CREATE VIEW x";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowCreateViewStatement show = (MySqlShowCreateViewStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW CREATE VIEW x", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method testSetTxn_3.
public void testSetTxn_3() throws Exception {
String sql = "SET session transaction ISOLATION LEVEL SERIALIZABLE";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlSetTransactionStatement set = (MySqlSetTransactionStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_slaveStatus.
public void test_show_slaveStatus() throws Exception {
String sql = "SHOW SLAVE Status";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowSlaveStatusStatement show = (MySqlShowSlaveStatusStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW SLAVE STATUS", output);
}
Aggregations