This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 6dab220 proofread SQLServer TCL statements (#12826)
6dab220 is described below
commit 6dab220ba6b5d760a632c372fed1ccf4c44a23b0
Author: Thanoshan MV <[email protected]>
AuthorDate: Wed Sep 29 21:22:57 2021 +0530
proofread SQLServer TCL statements (#12826)
---
.../src/main/antlr4/imports/sqlserver/BaseRule.g4 | 16 +++++++++
.../antlr4/imports/sqlserver/SQLServerKeyword.g4 | 12 +++++++
.../main/antlr4/imports/sqlserver/TCLStatement.g4 | 22 +++++++++---
.../sql/parser/autogen/SQLServerStatement.g4 | 3 ++
.../impl/SQLServerTCLStatementSQLVisitor.java | 21 +++++++++++-
.../core/database/visitor/SQLVisitorRule.java | 6 ++++
.../tcl/BeginDistributedTransactionStatement.java} | 36 ++++----------------
...erverBeginDistributedTransactionStatement.java} | 39 ++++++----------------
.../main/resources/case/tcl/begin-transaction.xml | 3 ++
.../src/main/resources/case/tcl/commit.xml | 1 +
.../src/main/resources/case/tcl/rollback.xml | 1 +
.../src/main/resources/case/tcl/savepoint.xml | 1 +
.../sql/supported/tcl/begin-transcation.xml | 3 ++
.../main/resources/sql/supported/tcl/commit.xml | 1 +
.../main/resources/sql/supported/tcl/rollback.xml | 1 +
.../main/resources/sql/supported/tcl/savepoint.xml | 1 +
16 files changed, 103 insertions(+), 64 deletions(-)
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
index 090680c..f1cc51b 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
@@ -464,3 +464,19 @@ variableName
executeAsClause
: (EXEC | EXECUTE) AS (CALLER | SELF | OWNER | stringLiterals)
;
+
+transactionName
+ : identifier
+ ;
+
+transactionVariableName
+ : variableName
+ ;
+
+savepointName
+ : identifier
+ ;
+
+savepointVariableName
+ : variableName
+ ;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
index 7b38643..2c721be 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
@@ -1314,3 +1314,15 @@ ABORT
INCLUDE
: I N C L U D E
;
+
+DISTRIBUTED
+ : D I S T R I B U T E D
+ ;
+
+MARK
+ : M A R K
+ ;
+
+WORK
+ : W O R K
+ ;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
index 23d627d..ebc889d 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
@@ -17,7 +17,7 @@
grammar TCLStatement;
-import Symbol, Keyword, SQLServerKeyword, Literals;
+import Symbol, Keyword, SQLServerKeyword, Literals, BaseRule;
setTransaction
: SET TRANSACTION
@@ -32,17 +32,29 @@ implicitTransactionsValue
;
beginTransaction
- : BEGIN (TRAN | TRANSACTION)
+ : BEGIN (TRAN | TRANSACTION) ((transactionName | transactionVariableName)
(WITH MARK (stringLiterals | NCHAR_TEXT)?)?)?
+ ;
+
+beginDistributedTransaction
+ : BEGIN DISTRIBUTED (TRAN | TRANSACTION) (transactionName |
transactionVariableName)?
;
commit
- : COMMIT
+ : COMMIT ((TRAN | TRANSACTION) (transactionName |
transactionVariableName)?)? (WITH LP_ DELAYED_DURABILITY = (OFF | ON) RP_)?
+ ;
+
+commitWork
+ : COMMIT WORK?
;
rollback
- : ROLLBACK
+ : ROLLBACK (TRAN | TRANSACTION) (transactionName | transactionVariableName
| savepointName | savepointVariableName)?
+ ;
+
+rollbackWork
+ : ROLLBACK WORK?
;
savepoint
- : SAVE (TRAN | TRANSACTION)
+ : SAVE (TRAN | TRANSACTION) (savepointName | savepointVariableName)
;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQLServerStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQLServerStatement.g4
index 131407a..29d530f 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQLServerStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQLServerStatement.g4
@@ -47,9 +47,12 @@ execute
| createFunction
| setTransaction
| beginTransaction
+ | beginDistributedTransaction
| setImplicitTransactions
| commit
+ | commitWork
| rollback
+ | rollbackWork
| savepoint
| grant
| revoke
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
index a558a04..cf5ad18 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
@@ -18,15 +18,19 @@
package org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.impl;
import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sql.parser.api.visitor.operation.SQLStatementVisitor;
import org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
+import
org.apache.shardingsphere.sql.parser.api.visitor.operation.SQLStatementVisitor;
import org.apache.shardingsphere.sql.parser.api.visitor.type.TCLSQLVisitor;
+import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.BeginDistributedTransactionContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.BeginTransactionContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.CommitContext;
+import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.CommitWorkContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.RollbackContext;
+import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.RollbackWorkContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SavepointContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetImplicitTransactionsContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetTransactionContext;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerBeginDistributedTransactionStatement;
import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerBeginTransactionStatement;
import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerCommitStatement;
import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerRollbackStatement;
@@ -64,16 +68,31 @@ public final class SQLServerTCLStatementSQLVisitor extends
SQLServerStatementSQL
}
@Override
+ public ASTNode visitBeginDistributedTransaction(final
BeginDistributedTransactionContext ctx) {
+ return new SQLServerBeginDistributedTransactionStatement();
+ }
+
+ @Override
public ASTNode visitCommit(final CommitContext ctx) {
return new SQLServerCommitStatement();
}
@Override
+ public ASTNode visitCommitWork(final CommitWorkContext ctx) {
+ return new SQLServerCommitStatement();
+ }
+
+ @Override
public ASTNode visitRollback(final RollbackContext ctx) {
return new SQLServerRollbackStatement();
}
@Override
+ public ASTNode visitRollbackWork(final RollbackWorkContext ctx) {
+ return new SQLServerRollbackStatement();
+ }
+
+ @Override
public ASTNode visitSavepoint(final SavepointContext ctx) {
return new SQLServerSavepointStatement();
}
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
index 7253d44..6f8246c 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
@@ -158,6 +158,8 @@ public enum SQLVisitorRule {
BEGIN_TRANSACTION("BeginTransaction", SQLStatementType.TCL),
+ BEGIN_DISTRIBUTED_TRANSACTION("BeginDistributedTransaction",
SQLStatementType.TCL),
+
START_TRANSACTION("StartTransaction", SQLStatementType.TCL),
END("End", SQLStatementType.TCL),
@@ -166,8 +168,12 @@ public enum SQLVisitorRule {
COMMIT("Commit", SQLStatementType.TCL),
+ COMMIT_WORK("CommitWork", SQLStatementType.TCL),
+
ROLLBACK("Rollback", SQLStatementType.TCL),
+ ROLLBACK_WORK("RollbackWork", SQLStatementType.TCL),
+
SAVEPOINT("Savepoint", SQLStatementType.TCL),
RELEASE_SAVEPOINT("ReleaseSavepoint", SQLStatementType.TCL),
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/BeginDistributedTransactionStatement.java
similarity index 63%
copy from
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
copy to
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/BeginDistributedTransactionStatement.java
index 23d627d..de2e317 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/BeginDistributedTransactionStatement.java
@@ -15,34 +15,12 @@
* limitations under the License.
*/
-grammar TCLStatement;
+package org.apache.shardingsphere.sql.parser.sql.common.statement.tcl;
-import Symbol, Keyword, SQLServerKeyword, Literals;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
-setTransaction
- : SET TRANSACTION
- ;
-
-setImplicitTransactions
- : (IF AT_ AT_ TRANCOUNT GT_ NUMBER_ COMMIT TRAN)? SET
IMPLICIT_TRANSACTIONS implicitTransactionsValue
- ;
-
-implicitTransactionsValue
- : ON | OFF
- ;
-
-beginTransaction
- : BEGIN (TRAN | TRANSACTION)
- ;
-
-commit
- : COMMIT
- ;
-
-rollback
- : ROLLBACK
- ;
-
-savepoint
- : SAVE (TRAN | TRANSACTION)
- ;
+/**
+ * Begin distributed transaction statement.
+ */
+public abstract class BeginDistributedTransactionStatement extends
AbstractSQLStatement implements TCLStatement {
+}
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/sqlserver/tcl/SQLServerBeginDistributedTransactionStatement.java
similarity index 60%
copy from
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
copy to
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/sqlserver/tcl/SQLServerBeginDistributedTransactionStatement.java
index 23d627d..36783a6 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/TCLStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/sqlserver/tcl/SQLServerBeginDistributedTransactionStatement.java
@@ -15,34 +15,15 @@
* limitations under the License.
*/
-grammar TCLStatement;
+package
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl;
-import Symbol, Keyword, SQLServerKeyword, Literals;
+import lombok.ToString;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.BeginDistributedTransactionStatement;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.SQLServerStatement;
-setTransaction
- : SET TRANSACTION
- ;
-
-setImplicitTransactions
- : (IF AT_ AT_ TRANCOUNT GT_ NUMBER_ COMMIT TRAN)? SET
IMPLICIT_TRANSACTIONS implicitTransactionsValue
- ;
-
-implicitTransactionsValue
- : ON | OFF
- ;
-
-beginTransaction
- : BEGIN (TRAN | TRANSACTION)
- ;
-
-commit
- : COMMIT
- ;
-
-rollback
- : ROLLBACK
- ;
-
-savepoint
- : SAVE (TRAN | TRANSACTION)
- ;
+/**
+ * SQLServer begin distributed transaction statement.
+ */
+@ToString
+public final class SQLServerBeginDistributedTransactionStatement extends
BeginDistributedTransactionStatement implements SQLServerStatement {
+}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/begin-transaction.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/begin-transaction.xml
index 1aa6df5..379b678 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/begin-transaction.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/begin-transaction.xml
@@ -20,7 +20,10 @@
<begin-transaction sql-case-id="begin" />
<begin-transaction sql-case-id="beginTransaction" />
<begin-transaction sql-case-id="beginWithName" />
+ <begin-transaction sql-case-id="begin_with_variable_name" />
<begin-transaction sql-case-id="beginReadCommitted" />
<begin-transaction sql-case-id="beginReadOnly" />
<begin-transaction sql-case-id="begin_with_transaction_mode" />
+ <begin-transaction sql-case-id="begin_with_mark_transaction" />
+ <begin-transaction sql-case-id="begin_distributed_transaction" />
</sql-parser-test-cases>
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/commit.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/commit.xml
index 8a6c517..7278ba9 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/commit.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/commit.xml
@@ -18,6 +18,7 @@
<sql-parser-test-cases>
<commit sql-case-id="commit" />
+ <commit sql-case-id="commit_transaction" />
<commit sql-case-id="commitWithName" />
<commit sql-case-id="commitWithComment" />
<commit sql-case-id="commitForce" />
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/rollback.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/rollback.xml
index 42e2ee3..940c026 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/rollback.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/rollback.xml
@@ -18,6 +18,7 @@
<sql-parser-test-cases>
<rollback sql-case-id="rollback" />
+ <rollback sql-case-id="rollback_transaction" />
<rollback sql-case-id="rollbackWithName" />
<rollback sql-case-id="rollbackToSavepoint" />
<rollback sql-case-id="rollbackForce" />
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/savepoint.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/savepoint.xml
index 9a904bb..719aa4e 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/savepoint.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/tcl/savepoint.xml
@@ -18,4 +18,5 @@
<sql-parser-test-cases>
<savepoint sql-case-id="savepoint" />
+ <savepoint sql-case-id="savepoint_transaction" />
</sql-parser-test-cases>
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/begin-transcation.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/begin-transcation.xml
index b2a77a2..0e4d95e 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/begin-transcation.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/begin-transcation.xml
@@ -20,7 +20,10 @@
<sql-case id="begin" value="BEGIN" db-types="MySQL,PostgreSQL" />
<sql-case id="beginTransaction" value="BEGIN TRANSACTION"
db-types="SQLServer,PostgreSQL" />
<sql-case id="beginWithName" value="BEGIN TRANSACTION transaction1"
db-types="SQLServer" />
+ <sql-case id="begin_with_variable_name" value="BEGIN TRANSACTION
@TranName" db-types="SQLServer" />
<sql-case id="beginReadCommitted" value="BEGIN ISOLATION LEVEL READ
COMMITTED" db-types="PostgreSQL" />
<sql-case id="beginReadOnly" value="BEGIN READ ONLY" db-types="PostgreSQL"
/>
<sql-case id="begin_with_transaction_mode" value="BEGIN TRANSACTION
ISOLATION LEVEL READ COMMITTED" db-types="PostgreSQL" />
+ <sql-case id="begin_with_mark_transaction" value="BEGIN TRANSACTION
CandidateDelete WITH MARK N'Deleting a Job Candidate'" db-types="SQLServer" />
+ <sql-case id="begin_distributed_transaction" value="BEGIN DISTRIBUTED
TRANSACTION" db-types="SQLServer" />
</sql-cases>
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/commit.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/commit.xml
index 5d97c60..5492613 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/commit.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/commit.xml
@@ -18,6 +18,7 @@
<sql-cases>
<sql-case id="commit" value="COMMIT"
db-types="MySQL,Oracle,SQLServer,PostgreSQL" />
+ <sql-case id="commit_transaction" value="COMMIT TRANSACTION"
db-types="SQLServer" />
<sql-case id="commitWithName" value="COMMIT TRANSACTION transaction1"
db-types="SQLServer" />
<sql-case id="commitWithComment" value="COMMIT COMMENT 'comment1'"
db-types="Oracle" />
<sql-case id="commitForce" value="COMMIT FORCE 'transaction1'"
db-types="Oracle" />
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/rollback.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/rollback.xml
index d2ada0e..83406f1 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/rollback.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/rollback.xml
@@ -18,6 +18,7 @@
<sql-cases>
<sql-case id="rollback" value="ROLLBACK"
db-types="MySQL,Oracle,PostgreSQL,SQLServer" />
+ <sql-case id="rollback_transaction" value="ROLLBACK TRAN @TransactionName"
db-types="SQLServer" />
<sql-case id="rollbackWithName" value="ROLLBACK TRANSACTION transaction1"
db-types="SQLServer" />
<sql-case id="rollbackToSavepoint" value="ROLLBACK TO savepoint1" />
<sql-case id="rollbackForce" value="ROLLBACK FORCE 'transaction1'"
db-types="Oracle" />
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/savepoint.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/savepoint.xml
index f91eae5..8bc924b 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/savepoint.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/tcl/savepoint.xml
@@ -18,4 +18,5 @@
<sql-cases>
<sql-case id="savepoint" value="SAVEPOINT savepoint1"
db-types="MySQL,PostgreSQL,Oracle" />
+ <sql-case id="savepoint_transaction" value="SAVE TRANSACTION
ProcedureSave" db-types="SQLServer" />
</sql-cases>