use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class MiscellaneousFunctionsTest method test_3.
public void test_3() throws Exception {
String sql = "SELECT UUID();";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT UUID();", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class MiscellaneousFunctionsTest method test_2.
public void test_2() throws Exception {
String sql = "SELECT INET_ATON('209.207.224.40');";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT INET_ATON('209.207.224.40');", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class MiscellaneousFunctionsTest method test_1.
public void test_1() throws Exception {
String sql = "SELECT GET_LOCK('lock1',10);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT GET_LOCK('lock1', 10);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class LoadDataInFileSyntaxTest method test_0.
public void test_0() throws Exception {
String sql = "LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class LoadDataInFileSyntaxTest method test_3.
public void test_3() throws Exception {
String sql = "LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name COLUMNS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;", text);
}
Aggregations