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);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_index_1.
public void test_show_index_1() throws Exception {
String sql = "SHOW index in tb1 in db";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowIndexesStatement show = (MySqlShowIndexesStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW INDEX 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_function_code.
public void test_show_function_code() throws Exception {
String sql = "SHOW function code x";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowFunctionCodeStatement show = (MySqlShowFunctionCodeStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW FUNCTION CODE x", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method testSetTxn_1.
public void testSetTxn_1() throws Exception {
String sql = "SET global transaction ISOLATION LEVEL READ COMMITTED";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlSetTransactionStatement set = (MySqlSetTransactionStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method testSetTxn_0.
public void testSetTxn_0() throws Exception {
String sql = "SET transaction ISOLATION LEVEL READ UNCOMMITTED";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlSetTransactionStatement set = (MySqlSetTransactionStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED", output);
}
Aggregations