You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zhuruixuan (via GitHub)" <gi...@apache.org> on 2024/04/02 04:58:12 UTC
[PR] Enhance the support for Oracle SQL parsing [shardingsphere]
zhuruixuan opened a new pull request, #30742:
URL: https://github.com/apache/shardingsphere/pull/30742
Fixes #27067.
Changes proposed in this pull request:
-Enhance the support for Oracle SQL parsing in ShardingSphere
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [x] I have (or in comment I request) added corresponding labels for the pull request.
- [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [x] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enhance the support for Oracle SQL parsing [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on code in PR #30742:
URL: https://github.com/apache/shardingsphere/pull/30742#discussion_r1547183642
##########
test/it/parser/src/main/resources/sql/supported/ddl/create-trigger.xml:
##########
@@ -50,4 +50,47 @@
BEGIN
:NEW.ID := Contacts_Seq.NEXTVAL;
END;" db-types="Oracle" />
+ <sql-case id="create_trigger_with_dataManipulationLanguage_statement" value="CREATE OR REPLACE TRIGGER lineitems_trigger
+ AFTER INSERT OR UPDATE OR DELETE ON lineitems
+ FOR EACH ROW
+BEGIN
+ IF (INSERTING OR UPDATING)
+ THEN
+ UPDATE orders SET line_items_count = NVL(line_items_count,0)+1
+ WHERE order_id = :new.order_id;
+ END IF;
+ IF (DELETING OR UPDATING)
+ THEN
+ UPDATE orders SET line_items_count = NVL(line_items_count,0)-1
+ WHERE order_id = :old.order_id;
+ END IF;
+END;" db-types="Oracle"/>
+ <sql-case id="create_trigger_with_exceptionInit_pragma" value="CREATE OR REPLACE TRIGGER Employee_permit_changes
+ BEFORE INSERT OR DELETE OR UPDATE ON employees
+DECLARE
+ Dummy INTEGER;
+ Not_on_weekends EXCEPTION;
+ Nonworking_hours EXCEPTION;
+ PRAGMA EXCEPTION_INIT (Not_on_weekends, -4097);
+ PRAGMA EXCEPTION_INIT (Nonworking_hours, -4099);
+BEGIN
+
Review Comment:
Please remove this useless blank line.
##########
test/it/parser/src/main/resources/sql/supported/ddl/create-trigger.xml:
##########
@@ -50,4 +50,47 @@
BEGIN
:NEW.ID := Contacts_Seq.NEXTVAL;
END;" db-types="Oracle" />
+ <sql-case id="create_trigger_with_dataManipulationLanguage_statement" value="CREATE OR REPLACE TRIGGER lineitems_trigger
+ AFTER INSERT OR UPDATE OR DELETE ON lineitems
Review Comment:
Is it possible to increase the indentation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enhance the support for Oracle SQL parsing [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu merged PR #30742:
URL: https://github.com/apache/shardingsphere/pull/30742
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enhance the support for Oracle SQL parsing [shardingsphere]
Posted by "zhuruixuan (via GitHub)" <gi...@apache.org>.
zhuruixuan commented on code in PR #30742:
URL: https://github.com/apache/shardingsphere/pull/30742#discussion_r1547244037
##########
test/it/parser/src/main/resources/sql/supported/ddl/create-trigger.xml:
##########
@@ -50,4 +50,47 @@
BEGIN
:NEW.ID := Contacts_Seq.NEXTVAL;
END;" db-types="Oracle" />
+ <sql-case id="create_trigger_with_dataManipulationLanguage_statement" value="CREATE OR REPLACE TRIGGER lineitems_trigger
+ AFTER INSERT OR UPDATE OR DELETE ON lineitems
Review Comment:
I have added appropriate indentation to improve the readability of the code
> Is it possible to increase the indentation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org