You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/02/24 02:00:50 UTC
[shardingsphere] branch master updated: fix Oracle and SQLServer
parser warning (#9472)
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 244d498 fix Oracle and SQLServer parser warning (#9472)
244d498 is described below
commit 244d49886690cfd885a84924ff3a2d3a0e84a690
Author: JingShang Lu <lu...@apache.org>
AuthorDate: Tue Feb 23 18:00:15 2021 -0800
fix Oracle and SQLServer parser warning (#9472)
---
.../src/main/antlr4/imports/oracle/OracleKeyword.g4 | 16 ++++++++--------
.../src/main/antlr4/imports/oracle/TCLStatement.g4 | 2 +-
.../src/main/antlr4/imports/sqlserver/BaseRule.g4 | 2 +-
.../src/main/antlr4/imports/sqlserver/DMLStatement.g4 | 2 +-
.../src/main/antlr4/imports/sqlserver/Literals.g4 | 4 ++++
.../main/antlr4/imports/sqlserver/SQLServerKeyword.g4 | 4 ++++
6 files changed, 19 insertions(+), 11 deletions(-)
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 31a6493..e11b0ad 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
@@ -291,6 +291,10 @@ NOMINVALUE
: N O M I N V A L U E
;
+NOSORT
+ : N O S O R T
+ ;
+
MINING
: M I N I N G
;
@@ -359,6 +363,10 @@ RESOURCE
: R E S O U R C E
;
+REVERSE
+ : R E V E R S E
+ ;
+
ROWID
: R O W I D
;
@@ -891,10 +899,6 @@ PARALLEL
: P A R A L L E L
;
-INVALIDATION
- : I N V A L I D A T I O N
- ;
-
LOG
: L O G
;
@@ -907,10 +911,6 @@ STORAGE
: S T O R A G E
;
-ONLINE
- : O N L I N E
- ;
-
MATCHED
: M A T C H 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 7bb3ce4..b2c0f4f 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
@@ -24,7 +24,7 @@ setTransaction
;
commit
- : COMMIT WORK? ((commentClause? writeClause?) | forceClause)?
+ : COMMIT WORK? (commentClause | writeClause | forceClause)?
;
commentClause
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 2da18c4..ba3df93 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
@@ -71,7 +71,7 @@ unreservedWord
| ARRAY | LOCALTIME | LOCALTIMESTAMP | QUARTER | WEEK | MICROSECOND | ENABLE
| DISABLE | BINARY | HIDDEN_ | MOD | PARTITION | TOP | ROW
| XOR | ALWAYS | ROLE | START | ALGORITHM | AUTO | BLOCKERS
- | CLUSTERED | COLUMNSTORE | CONTENT | DATABASE | DAYS | DENY | DETERMINISTIC
+ | CLUSTERED | COLUMNSTORE | CONTENT | CONCAT | DATABASE | DAYS | DENY | DETERMINISTIC
| DISTRIBUTION | DOCUMENT | DURABILITY | ENCRYPTED | FILESTREAM | FILETABLE | FOLLOWING
| HASH | HEAP | INBOUND | INFINITE | LOGIN | MASKED | MAXDOP
| MINUTES | MONTHS | MOVE | NOCHECK | NONCLUSTERED | OBJECT | OFF
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
index 9cced46..1cfc1a5 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
@@ -209,7 +209,7 @@ queryHint
| RECOMPILE
| ROBUST PLAN
| USE HINT LP_ useHitName* RP_
- | USE PLAN N STRING_
+ | USE PLAN NCHAR_TEXT
;
useHitName
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/Literals.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/Literals.g4
index fd8e727..e432d10 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/Literals.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/Literals.g4
@@ -54,6 +54,10 @@ BIT_NUM_
: '0b' ('0' | '1')+ | B SQ_ ('0' | '1')+ SQ_
;
+NCHAR_TEXT
+ : N STRING_
+ ;
+
fragment DIGIT
: [0-9]
;
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 bdf58d9..a9fa7f6 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
@@ -391,6 +391,10 @@ CONTROL
: C O N T R O L
;
+CONCAT
+ : C O N C A T
+ ;
+
TAKE
: T A K E
;