improved sql server parser, support merge. for issue #2118

This commit is contained in:
wenshao
2017-11-20 16:31:19 +08:00
parent 236586c3f7
commit 077ce62ab0
4 changed files with 79 additions and 3 deletions
@@ -334,19 +334,19 @@ public class SQLStatementParser extends SQLParser {
continue;
}
if (lexer.identifierEquals("RELEASE")) {
if (lexer.identifierEquals(FnvHash.Constants.RELEASE)) {
SQLStatement stmt = parseReleaseSavePoint();
statementList.add(stmt);
continue;
}
if (lexer.identifierEquals("SAVEPOINT")) {
if (lexer.identifierEquals(FnvHash.Constants.SAVEPOINT)) {
SQLStatement stmt = parseSavePoint();
statementList.add(stmt);
continue;
}
if (lexer.identifierEquals("ROLLBACK")) {
if (lexer.identifierEquals(FnvHash.Constants.ROLLBACK)) {
SQLRollbackStatement stmt = parseRollback();
statementList.add(stmt);
@@ -358,6 +358,13 @@ public class SQLStatementParser extends SQLParser {
continue;
}
if (lexer.identifierEquals(FnvHash.Constants.MERGE)) {
SQLStatement stmt = parseMerge();
stmt.setParent(parent);
statementList.add(stmt);
continue;
}
if (lexer.identifierEquals(FnvHash.Constants.COMMIT)) {
SQLStatement stmt = parseCommit();