use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_table_status.
public void test_show_table_status() throws Exception {
String sql = "SHOW TABLE STATUS FROM mysql";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowTableStatusStatement show = (MySqlShowTableStatusStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW TABLE STATUS FROM mysql", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_engines_1.
public void test_show_engines_1() throws Exception {
String sql = "SHOW STORAGE ENGINES";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowEnginesStatement show = (MySqlShowEnginesStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW STORAGE ENGINES", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_binaryLog_2.
public void test_binaryLog_2() throws Exception {
String sql = "SHOW binlog events ";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowBinLogEventsStatement show = (MySqlShowBinLogEventsStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW BINLOG EVENTS", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method testSet_2.
public void testSet_2() throws Exception {
String sql = "SET `sysVar1` = ?, @@gloBal . `var2` :=1";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLSetStatement set = (SQLSetStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET @@`sysVar1` = ?, @@global.`var2` = 1", output);
}
use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser in project druid by alibaba.
the class DALParserTest method test_show_errors_2.
public void test_show_errors_2() throws Exception {
String sql = "SHOW ERRORS limit 1";
MySqlStatementParser parser = new MySqlStatementParser(sql);
MySqlShowErrorsStatement show = (MySqlShowErrorsStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(show);
Assert.assertEquals("SHOW ERRORS LIMIT 1", output);
}
Aggregations