This is an automated email from the ASF dual-hosted git repository.

panjuan 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 ce7b135  Proofread Oracle SQL - SET TRANSACTION (#10514)
ce7b135 is described below

commit ce7b135f30b6647513d50eb58a8910e2ea08d8a2
Author: Liangda-w <[email protected]>
AuthorDate: Sun May 30 15:18:51 2021 +0200

    Proofread Oracle SQL - SET TRANSACTION (#10514)
---
 .../src/main/antlr4/imports/oracle/BaseRule.g4               |  5 +++++
 .../src/main/antlr4/imports/oracle/OracleKeyword.g4          | 12 ++++++++++++
 .../src/main/antlr4/imports/oracle/TCLStatement.g4           |  5 ++++-
 .../src/main/resources/case/tcl/set-transaction.xml          |  4 ++++
 .../src/main/resources/sql/supported/tcl/set-transaction.xml |  4 ++++
 5 files changed, 29 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
index 8d09612..70dc48c 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
@@ -666,3 +666,8 @@ rowcount
 percent
     : numberLiterals | expr | nullValueLiterals
     ;
+
+rollbackSegment
+    : identifier
+    ;
+
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
index dd3d83b..2a1dd4e 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
@@ -1958,3 +1958,15 @@ NULLS
 LAST
     : L A S T
     ;
+
+ISOLATION
+    : I S O L A T I O N
+    ;
+
+SERIALIZABLE
+    : S E R I A L I Z A B L E
+    ;
+
+COMMITTED
+    : C O M M I T T E D
+    ;
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/TCLStatement.g4
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/TCLStatement.g4
index b2c0f4f..c09e556 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/TCLStatement.g4
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/TCLStatement.g4
@@ -20,7 +20,10 @@ grammar TCLStatement;
 import Symbol, Keyword, OracleKeyword, Literals, BaseRule;
 
 setTransaction
-    : SET TRANSACTION
+    : SET TRANSACTION ((READ (ONLY | WRITE)
+    | ISOLATION LEVEL (SERIALIZABLE | READ COMMITTED)
+    | USE ROLLBACK SEGMENT rollbackSegment) (NAME stringLiterals)?
+    | NAME stringLiterals)
     ;
 
 commit
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/tcl/set-transaction.xml
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/tcl/set-transaction.xml
index 303c174..28e1f2a 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/tcl/set-transaction.xml
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/tcl/set-transaction.xml
@@ -21,6 +21,10 @@
     <set-transaction sql-case-id="setGlobalTransaction" />
     <set-transaction sql-case-id="setSessionTransaction" />
     <set-transaction sql-case-id="setTransactionReadOnly" />
+    <set-transaction sql-case-id="setTransactionReadWriteWithName" />
+    <set-transaction sql-case-id="setTransactionIsolationLevelSerializable" />
+    <set-transaction sql-case-id="setTransactionIsolationLevelReadCommitted" />
+    <set-transaction sql-case-id="setTransactionUseRollbackSegment" />
     <set-transaction sql-case-id="setTransactionWithName" />
     <set-transaction sql-case-id="setTransactionSnapshot" />
     <xa sql-case-id="xa-recover" />
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/tcl/set-transaction.xml
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/tcl/set-transaction.xml
index 8c51386..325b474 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/tcl/set-transaction.xml
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/tcl/set-transaction.xml
@@ -21,6 +21,10 @@
     <sql-case id="setGlobalTransaction" value="SET GLOBAL TRANSACTION 
ISOLATION LEVEL REPEATABLE READ" db-types="MySQL" />
     <sql-case id="setSessionTransaction" value="SET SESSION CHARACTERISTICS AS 
TRANSACTION ISOLATION LEVEL READ COMMITTED" db-types="PostgreSQL" />
     <sql-case id="setTransactionReadOnly" value="SET TRANSACTION READ ONLY" 
db-types="MySQL,Oracle" />
+    <sql-case id="setTransactionReadWriteWithName" value="SET TRANSACTION READ 
WRITE NAME 'Toronto'" db-types="Oracle" />
+    <sql-case id="setTransactionIsolationLevelSerializable" value="SET 
TRANSACTION ISOLATION LEVEL SERIALIZABLE" db-types="Oracle" />
+    <sql-case id="setTransactionIsolationLevelReadCommitted" value="SET 
TRANSACTION ISOLATION LEVEL READ COMMITTED" db-types="Oracle" />
+    <sql-case id="setTransactionUseRollbackSegment" value="SET TRANSACTION USE 
ROLLBACK SEGMENT rbs_ts" db-types="Oracle" />
     <sql-case id="setTransactionWithName" value="SET TRANSACTION NAME 
'comment1'" db-types="Oracle,SQLServer" />
     <sql-case id="setTransactionSnapshot" value="SET TRANSACTION SNAPSHOT 
'snapshot1'" db-types="PostgreSQL" />
     <sql-case id="xa-recover" value="XA RECOVER" db-types="MySQL" />

Reply via email to