use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ComparisonFunctionsAndOperatorsTest method test_24.
public void test_24() throws Exception {
String sql = "SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ComparisonFunctionsAndOperatorsTest method test_9.
public void test_9() throws Exception {
String sql = "SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 1 IS true, 0 IS false, NULL IS UNKNOWN;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class BitFunctionsTest method test_4.
public void test_4() throws Exception {
String sql = "SELECT 1 << 2";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 1 << 2;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class BitFunctionsTest method test_2.
public void test_2() throws Exception {
String sql = "SELECT 1 ^ 1";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 1 ^ 1;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class CastFunctionsAndOperatorsTest method test_3.
public void test_3() throws Exception {
String sql = "SELECT 'A' LIKE CONVERT(blob_col USING latin1) FROM tbl_name;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 'A' LIKE CONVERT(blob_col USING latin1)\nFROM tbl_name;", text);
}
Aggregations