use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class CastFunctionsAndOperatorsTest method test_5.
public void test_5() throws Exception {
String sql = "SET @str = BINARY 'New York';";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SET @str = BINARY 'New York';", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ArithmeticOperatorsTest method test_1.
public void test_1() throws Exception {
String sql = "SELECT 3-5;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 3 - 5;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ArithmeticOperatorsTest method test_11.
public void test_11() throws Exception {
String sql = "SELECT N % M;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT N % M;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ArithmeticOperatorsTest method test_13.
public void test_13() throws Exception {
String sql = "SELECT 1 = 0 AND ID = ?;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT 1 = 0\n\tAND ID = ?;", text);
}
use of com.alibaba.druid.sql.parser.SQLStatementParser in project druid by alibaba.
the class ArithmeticOperatorsTest method test_2.
public void test_2() throws Exception {
String sql = "SELECT - 2;";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("SELECT -2;", text);
}
Aggregations