use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_26.
public void test_26() throws Exception {
String sql = "SELECT INTERVAL '-1 10' DAY_HOUR;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT INTERVAL '-1 10' DAY_HOUR;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_35.
public void test_35() throws Exception {
String sql = "SELECT FROM_UNIXTIME(1196440219);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT FROM_UNIXTIME(1196440219);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_38.
public void test_38() throws Exception {
String sql = "SELECT NOW(), SLEEP(2), NOW();";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT NOW(), SLEEP(2), NOW();", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_20.
public void test_20() throws Exception {
String sql = "SELECT '2005-01-01' - INTERVAL 1 SECOND;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT '2005-01-01' - INTERVAL 1 SECOND;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_23.
public void test_23() throws Exception {
String sql = "SELECT DATE_ADD('2009-01-01', INTERVAL 6/4 MINUTE_SECOND);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT DATE_ADD('2009-01-01', INTERVAL 6 / 4 MINUTE_SECOND);", text);
}
Aggregations