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 03255d2805e add PRIORITY as unreserved key word for oracle (#20044)
03255d2805e is described below

commit 03255d2805ed9a2f921374db580f914f13a9c2fd
Author: tianhao960 <[email protected]>
AuthorDate: Thu Aug 11 10:53:59 2022 +0800

    add PRIORITY as unreserved key word for oracle (#20044)
---
 .../src/main/antlr4/imports/oracle/BaseRule.g4                |  2 +-
 .../src/main/resources/case/dml/select.xml                    | 11 +++++++++++
 .../src/main/resources/sql/supported/dml/select.xml           |  1 +
 3 files changed, 13 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 2c69d13c430..8057b6b1e67 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
@@ -97,7 +97,7 @@ unreservedWord
     | SYSGUID | SYSBACKUP | SYSDBA | SYSDG | SYSKM | SYSOPER | DBA_RECYCLEBIN 
|SCHEMA
     | DO | DEFINER | CURRENT_USER | CASCADED | CLOSE | OPEN | NEXT | NAME | 
NAMES
     | COLLATION | REAL | TYPE | FIRST | RANK | SAMPLE | SYSTIMESTAMP | 
INTERVAL | MINUTE | ANY 
-    | LENGTH | SINGLE_C | capacityUnit | TARGET | PUBLIC | ID | STATE
+    | LENGTH | SINGLE_C | capacityUnit | TARGET | PUBLIC | ID | STATE | 
PRIORITY
     ;
 
 schemaName
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
index c7ea9d66755..ae5d58a62f6 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
@@ -4370,6 +4370,17 @@
         </projections>
     </select>
 
+    <select sql-case-id="select_with_keyword_priority">
+        <from>
+            <simple-table name="sys_menu" start-index="23" stop-index="32" 
alias="m" />
+        </from>
+        <projections start-index="7" stop-index="16">
+            <column-projection name="priority" start-index="7" stop-index="16">
+                <owner name="m" start-index="7" stop-index="7" />
+            </column-projection>
+        </projections>
+    </select>
+
     <select sql-case-id="select_with_xml_namespaces_clause">
         <from>
             <simple-table name="t_order" start-index="97" stop-index="103" />
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
index 1fcba0309e4..a92914db8c3 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
@@ -127,6 +127,7 @@
     <sql-case id="select_with_for_json_clause" value="SELECT order_id, status 
FROM t_order FOR JSON AUTO, INCLUDE_NULL_VALUES" db-types="SQLServer" />
     <sql-case id="select_with_keyword_target" value="SELECT m.target FROM 
sys_menu m" />
     <sql-case id="select_with_keyword_maxvalue" value="SELECT m.maxvalue FROM 
sys_menu m" />
+    <sql-case id="select_with_keyword_priority" value="SELECT m.priority FROM 
sys_menu m" db-types="Oracle" />
     <sql-case id="select_with_xml_namespaces_clause" value="WITH XMLNAMESPACES 
('uri' AS ns1) SELECT order_id AS 'ns1:order_id', status AS 'ns1:status' FROM 
t_order FOR XML RAW ('ns1:order'), ELEMENTS" db-types="SQLServer" />
     <sql-case id="select_with_xml_default_namespaces_clause" value="WITH 
XMLNAMESPACES ('uri1' AS ns1, 'uri2' AS ns2, DEFAULT 'uri2') SELECT order_id AS 
'ns1:order_id', status AS 'ns1:status' FROM t_order FOR XML RAW ('ns1:order'), 
ELEMENTS XSINIL" db-types="SQLServer" />
     <sql-case id="select_with_mysql_main_and_utc_data_and_so_on" value="SELECT 
MYSQL_MAIN,UTC_DATE,UTC_TIME,UTC_TIMESTAMP FROM test" db-types="MySQL" />

Reply via email to