use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_events_4.
public void test_show_events_4() throws Exception {
String sql = "SHOW EVENTS in x where 1 = 1";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW EVENTS FROM x WHERE 1 = 1", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class MTSParserTest method test_mts_2.
public void test_mts_2() throws Exception {
String sql = " savepoInt `select`";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("SAVEPOINT `select`", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class MTSParserTest method test_lockTable.
public void test_lockTable() throws Exception {
String sql = "LOCK TABLES t1 READ;";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("LOCK TABLES t1 READ", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class MTSParserTest method test_mts_3.
public void test_mts_3() throws Exception {
String sql = "Release sAVEPOINT xx ";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("RELEASE SAVEPOINT xx", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class MTSParserTest method test_mts_0.
public void test_mts_0() throws Exception {
String sql = " savepoint xx";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("SAVEPOINT xx", output);
}
Aggregations