use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_24.
public void test_24() 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_14.
public void test_14() throws Exception {
String sql = "SELECT CURDATE() + 0;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT CURDATE() + 0;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_32.
public void test_32() throws Exception {
String sql = "SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class MathematicalFunctionsTest method test_2.
public void test_2() throws Exception {
String sql = "SELECT ABS(-32);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT ABS(-32);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class MathematicalFunctionsTest method test_19.
public void test_19() throws Exception {
String sql = "SELECT MOD(29,9)";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT MOD(29, 9);", text);
}
Aggregations