You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2024/03/15 05:42:45 UTC
(shardingsphere) branch master updated: Add EOF in SQL92 (#30433)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 030a0bd995f Add EOF in SQL92 (#30433)
030a0bd995f is described below
commit 030a0bd995f101989f43707a13d86b58ac23ac2f
Author: yydeng626 <yy...@gmail.com>
AuthorDate: Fri Mar 15 13:42:38 2024 +0800
Add EOF in SQL92 (#30433)
* Add EOF in sql92
* Fix oracle antlr code style
Remove rewrite error sql92 sql
---
.../apache/shardingsphere/sql/parser/autogen/OracleStatement.g4 | 1 -
.../apache/shardingsphere/sql/parser/autogen/SQL92Statement.g4 | 2 +-
.../src/test/resources/scenario/sharding/case/dml/insert.xml | 8 ++++----
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/parser/sql/dialect/oracle/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OracleStatement.g4 b/parser/sql/dialect/oracle/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OracleStatement.g4
index 2aac4d82fd3..ca44b07e98e 100644
--- a/parser/sql/dialect/oracle/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OracleStatement.g4
+++ b/parser/sql/dialect/oracle/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OracleStatement.g4
@@ -19,7 +19,6 @@ grammar OracleStatement;
import DMLStatement, DCLStatement, DDLStatement, TCLStatement, DALStatement, PLSQL;
-
execute
: (select
| insert
diff --git a/parser/sql/dialect/sql92/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQL92Statement.g4 b/parser/sql/dialect/sql92/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQL92Statement.g4
index 3125664cad5..24e91c32aff 100644
--- a/parser/sql/dialect/sql92/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQL92Statement.g4
+++ b/parser/sql/dialect/sql92/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/SQL92Statement.g4
@@ -36,5 +36,5 @@ execute
| rollback
| grant
| revoke
- ) SEMI_?
+ ) SEMI_? EOF
;
diff --git a/test/it/rewriter/src/test/resources/scenario/sharding/case/dml/insert.xml b/test/it/rewriter/src/test/resources/scenario/sharding/case/dml/insert.xml
index 2356538e50a..802caa38193 100644
--- a/test/it/rewriter/src/test/resources/scenario/sharding/case/dml/insert.xml
+++ b/test/it/rewriter/src/test/resources/scenario/sharding/case/dml/insert.xml
@@ -17,22 +17,22 @@
-->
<rewrite-assertions yaml-rule="scenario/sharding/config/sharding-rule.yaml">
- <rewrite-assertion id="insert_values_with_columns_with_id_for_parameters" db-types="MySQL,openGauss,SQL92">
+ <rewrite-assertion id="insert_values_with_columns_with_id_for_parameters" db-types="MySQL,openGauss">
<input sql="INSERT INTO t_account (account_id, amount, status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE amount = VALUES(amount)" parameters="100, 1000, OK" />
<output sql="INSERT INTO t_account_0 (account_id, amount, status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE amount = VALUES(amount)" parameters="100, 1000, OK" />
</rewrite-assertion>
- <rewrite-assertion id="insert_values_with_columns_with_id_for_literals" db-types="MySQL,openGauss,SQL92">
+ <rewrite-assertion id="insert_values_with_columns_with_id_for_literals" db-types="MySQL,openGauss">
<input sql="INSERT INTO t_account (account_id, amount, status) VALUES (100, 1000, 'OK') ON DUPLICATE KEY UPDATE amount = VALUES(amount)" />
<output sql="INSERT INTO t_account_0 (account_id, amount, status) VALUES (100, 1000, 'OK') ON DUPLICATE KEY UPDATE amount = VALUES(amount)" />
</rewrite-assertion>
- <rewrite-assertion id="insert_values_with_uppercase_columns_with_id_for_parameters" db-types="MySQL,openGauss,SQL92">
+ <rewrite-assertion id="insert_values_with_uppercase_columns_with_id_for_parameters" db-types="MySQL,openGauss">
<input sql="INSERT INTO t_account (ACCOUNT_ID, amount, status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE amount = VALUES(amount)" parameters="100, 1000, OK" />
<output sql="INSERT INTO t_account_0 (ACCOUNT_ID, amount, status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE amount = VALUES(amount)" parameters="100, 1000, OK" />
</rewrite-assertion>
- <rewrite-assertion id="insert_values_with_uppercase_columns_with_id_for_literals" db-types="MySQL,openGauss,SQL92">
+ <rewrite-assertion id="insert_values_with_uppercase_columns_with_id_for_literals" db-types="MySQL,openGauss">
<input sql="INSERT INTO t_account (ACCOUNT_ID, amount, status) VALUES (100, 1000, 'OK') ON DUPLICATE KEY UPDATE amount = VALUES(amount)" />
<output sql="INSERT INTO t_account_0 (ACCOUNT_ID, amount, status) VALUES (100, 1000, 'OK') ON DUPLICATE KEY UPDATE amount = VALUES(amount)" />
</rewrite-assertion>