use of com.alibaba.cobar.parser.ast.stmt.mts.MTSReleaseStatement in project cobar by alibaba.
the class MySQLMTSParserTest method testRelease.
public void testRelease() throws SQLSyntaxErrorException {
String sql = "Release sAVEPOINT 1234e ";
MySQLMTSParser parser = new MySQLMTSParser(new MySQLLexer(sql));
MTSReleaseStatement savepoint = parser.release();
String output = output2MySQL(savepoint, sql);
Assert.assertEquals("RELEASE SAVEPOINT 1234e", output);
Assert.assertEquals("1234e", savepoint.getSavepoint().getIdText());
sql = "Release SAVEPOINT sAVEPOINT";
parser = new MySQLMTSParser(new MySQLLexer(sql));
savepoint = parser.release();
output = output2MySQL(savepoint, sql);
Assert.assertEquals("RELEASE SAVEPOINT sAVEPOINT", output);
Assert.assertEquals("sAVEPOINT", savepoint.getSavepoint().getIdText());
}
use of com.alibaba.cobar.parser.ast.stmt.mts.MTSReleaseStatement in project cobar by alibaba.
the class MySQLMTSParser method release.
/**
* first token <code>RELEASE</code> is scanned but not yet consumed
*/
public MTSReleaseStatement release() throws SQLSyntaxErrorException {
match(KW_RELEASE);
matchIdentifier("SAVEPOINT");
Identifier id = identifier();
match(EOF);
return new MTSReleaseStatement(id);
}
Aggregations