use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_open_tables_2.
public void test_open_tables_2() throws Exception {
String sql = "SHOW OPEN TABLES in 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);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_triggers.
public void test_show_triggers() throws Exception {
String sql = "SHOW TRIGGERS LIKE 'acc%'";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowTriggersStatement show = (MySqlShowTriggersStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW TRIGGERS LIKE 'acc%'", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_collation_2.
public void test_show_collation_2() throws Exception {
String sql = "SHOW COLLATION WHERE `Default` = 'Yes'";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowCollationStatement show = (MySqlShowCollationStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW COLLATION WHERE `Default` = 'Yes'", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_create_PROCEDURE.
public void test_show_create_PROCEDURE() throws Exception {
String sql = "SHOW CREATE PROCEDURE x";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowCreateProcedureStatement show = (MySqlShowCreateProcedureStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW CREATE PROCEDURE x", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_create_function.
public void test_show_create_function() throws Exception {
String sql = "SHOW CREATE function x";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowCreateFunctionStatement show = (MySqlShowCreateFunctionStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW CREATE FUNCTION x", output);
}
Aggregations