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 9250980 check PostgreSQL keywords (#7510)
9250980 is described below
commit 92509809de6e9f9fd9385b6f10c79a1a6d659cde
Author: JingShang Lu <[email protected]>
AuthorDate: Fri Sep 18 20:54:30 2020 +0800
check PostgreSQL keywords (#7510)
* fix #7067
* add test
---
.../antlr4/imports/postgresql/PostgreSQLKeyword.g4 | 4 ----
.../src/main/resources/case/dml/insert.xml | 20 ++++++++++++++++++++
.../src/main/resources/sql/supported/dml/insert.xml | 1 +
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
index 22183b3..4660de4 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
@@ -587,10 +587,6 @@ TSQUERY
: T S Q U E R Y
;
-UUID
- : U U I D
- ;
-
XML
: X M L
;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/dml/insert.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/dml/insert.xml
index 48f1c9f..b03d119 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/dml/insert.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/dml/insert.xml
@@ -100,6 +100,26 @@
</values>
</insert>
+ <insert sql-case-id="insert_with_columnname_uuid" parameters="1, 1">
+ <table name="t_order" start-index="12" stop-index="18" />
+ <columns start-index="20" stop-index="28">
+ <column name="id" start-index="21" stop-index="22" />
+ <column name="uuid" start-index="24" stop-index="27" />
+ </columns>
+ <values>
+ <value>
+ <assignment-value>
+ <parameter-marker-expression value="0" start-index="38"
stop-index="38"/>
+ <literal-expression value="1" start-index="38"
stop-index="38" />
+ </assignment-value>
+ <assignment-value>
+ <parameter-marker-expression value="1" start-index="41"
stop-index="41"/>
+ <literal-expression value="1" start-index="41"
stop-index="41" />
+ </assignment-value>
+ </value>
+ </values>
+ </insert>
+
<insert sql-case-id="insert_with_multiple_values">
<table name="t_order" start-index="12" stop-index="18" />
<columns start-index="20" stop-index="46">
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/insert.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/insert.xml
index aebc50b..20e4b45 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/insert.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/insert.xml
@@ -71,4 +71,5 @@
<sql-case id="insert_without_columns_with_default_values" value="INSERT
INTO t_order DEFAULT VALUES" db-types="SQLServer" />
<sql-case id="insert_with_top" value="INSERT TOP(10) t_order (order_id,
user_id) SELECT order_id, user_id FROM t_order" db-types="SQLServer" />
<sql-case id="insert_with_top_percent" value="INSERT TOP(10) PERCENT
t_order (order_id, user_id) SELECT order_id, user_id FROM t_order"
db-types="SQLServer" />
+ <sql-case id="insert_with_columnname_uuid" value="insert into t_order
(id,uuid) values (?, ?)" db-types="PostgreSQL" />
</sql-cases>