use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class HexadecimalValuesTest method test_5.
public void test_5() throws Exception {
String sql = "SELECT HEX('cat')";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT HEX('cat');", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class HexadecimalValuesTest method test_4.
public void test_4() throws Exception {
String sql = "SELECT 0x41, CAST(0x41 AS UNSIGNED)";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 0x41, CAST(0x41 AS UNSIGNED);", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class HexadecimalValuesTest method test_1.
public void test_1() throws Exception {
String sql = "SELECT X'4D7953514C';";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 0x4D7953514C;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class HexadecimalValuesTest method test_3.
public void test_3() throws Exception {
String sql = "SELECT 0x65 USING utf8;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 0x65 USING utf8;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class DateAndTimeFunctionsTest method test_50.
public void test_50() throws Exception {
String sql = "SELECT UNIX_TIMESTAMP();";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT UNIX_TIMESTAMP();", text);
}
Aggregations