use of com.alibaba.druid.sql.ast.statement.SQLSetStatement in project druid by alibaba.
the class DALParserTest method testSet_4.
public void testSet_4() throws Exception {
String sql = "SET GLOBAL var1=1, SESSION var2:=2";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLSetStatement set = (SQLSetStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET @@global.var1 = 1, @@var2 = 2", output);
}
use of com.alibaba.druid.sql.ast.statement.SQLSetStatement in project druid by alibaba.
the class DALParserTest method testSet_5.
public void testSet_5() throws Exception {
String sql = "SET @@GLOBAL. var1=1, SESSION var2:=2";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLSetStatement set = (SQLSetStatement) parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(set);
Assert.assertEquals("SET @@global.var1 = 1, @@var2 = 2", output);
}
Aggregations