use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ComparisonFunctionsAndOperatorsTest method test_26.
public void test_26() throws Exception {
String sql = "SELECT CAST(LEAST(3600, 9223372036854775808.0) as SIGNED);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT CAST(LEAST(3600, 9223372036854775808.0) AS SIGNED);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ComparisonFunctionsAndOperatorsTest method test_7.
public void test_7() throws Exception {
String sql = "SELECT 2 >= 2";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 2 >= 2;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ComparisonFunctionsAndOperatorsTest method test_22.
public void test_22() throws Exception {
String sql = "SELECT val1 FROM tbl1 WHERE val1 IN ('1','2','a');";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT val1\nFROM tbl1\nWHERE val1 IN ('1', '2', 'a');", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ControlFlowFunctionsTest method test_5.
public void test_5() throws Exception {
String sql = "SELECT IFNULL(1/0,'yes');";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT IFNULL(1 / 0, 'yes');", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ControlFlowFunctionsTest method test_4.
public void test_4() throws Exception {
String sql = "SELECT IFNULL(1,0);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT IFNULL(1, 0);", text);
}
Aggregations