lancelly opened a new pull request, #28625:
URL: https://github.com/apache/shardingsphere/pull/28625

   Related issue: https://github.com/apache/shardingsphere/issues/27569
   In this pr, I added several kinds of statement for createFunctionStatement 
of Oracle. I referred to this doc where you can find the detailed definition: 
https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/block.html#GUID-9ACEB9ED-567E-4E1A-A16A-B8B35214FC9D
   <img width="896" alt="截屏2023-10-02 22 34 15" 
src="https://github.com/apache/shardingsphere/assets/108499334/e894ecc8-f235-4dae-a7d0-feeb843ae958";>
   
   Now the following SQL can be parsed:
   "CREATE FUNCTION f(cur SYS_REFCURSOR, mgr_hiredate DATE) RETURN NUMBER IS 
emp_hiredate DATE; before number :=0; after number:=0; begin loop fetch cur 
into emp_hiredate; exit when cur%NOTFOUND; if emp_hiredate > mgr_hiredate then 
after:=after+1; else before:=before+1; end if; end loop; close cur; if before > 
after then return 1; else return 0; end if; end;
   "
   <img width="1868" alt="截屏2023-10-02 22 36 16" 
src="https://github.com/apache/shardingsphere/assets/108499334/b991dc87-7a6a-41dc-9baf-c295962e60fd";>
   <img width="1852" alt="截屏2023-10-02 22 41 22" 
src="https://github.com/apache/shardingsphere/assets/108499334/fa1d17bc-0cf5-4f6d-99e4-c17170b821ec";>
   
   The test suite does not allow special characters in case value and it seems 
that similar cases in the repo also do not have a related test. So I did not 
add the test cases in this PR:
   <img width="1670" alt="截屏2023-10-02 22 37 23" 
src="https://github.com/apache/shardingsphere/assets/108499334/ae824cc5-37f0-4bd4-be90-fdda1af599c2";>
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to