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 2086e609908 27920 (#29589)
2086e609908 is described below
commit 2086e609908bd4ca9249c7ad9be4525cf8054a92
Author: ilyas ahsan <[email protected]>
AuthorDate: Fri Dec 29 09:07:47 2023 +0700
27920 (#29589)
add space
---
parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/PLSQL.g4 | 5 ++---
test/it/parser/src/main/resources/case/ddl/create-function.xml | 1 +
.../parser/src/main/resources/sql/supported/ddl/create-function.xml | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/PLSQL.g4
b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/PLSQL.g4
index 8d34dbbc47c..979b0d0d2f8 100644
--- a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/PLSQL.g4
+++ b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/PLSQL.g4
@@ -64,10 +64,9 @@ plsqlFunctionSource
| deterministicClause
| parallelEnableClause
| resultCacheClause
- | aggregateClause
| pipelinedClause
- | sqlMacroClause)*
- (IS | AS) (callSpec | declareSection? body)
+ | sqlMacroClause)*
+ (aggregateClause | ((IS | AS) (callSpec | declareSection? body)))
;
body
diff --git a/test/it/parser/src/main/resources/case/ddl/create-function.xml
b/test/it/parser/src/main/resources/case/ddl/create-function.xml
index 252cf001497..fd83a87f8a8 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-function.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-function.xml
@@ -29,4 +29,5 @@
<create-function sql-case-id="create_function_with_set_var" />
<create-function sql-case-id="create_function_with_create_view" />
<create-function sql-case-id="create_function_with_loop" />
+ <create-function
sql-case-id="create_function_with_aggregate_using_function" />
</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/create-function.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/create-function.xml
index c1cb5a12ddc..863b4135a6c 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/create-function.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/create-function.xml
@@ -73,4 +73,5 @@
<sql-case id="create_function_with_set_var" value="CREATE DEFINER =
u1@localhost FUNCTION f2() RETURNS int BEGIN DECLARE n int; DECLARE m int; SET
n:= (SELECT min(a) FROM t1); SET m:= (SELECT max(a) FROM t1); RETURN n < m;
END ;" db-types="MySQL" />
<sql-case id="create_function_with_create_view" value="CREATE FUNCTION
bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END"
db-types="MySQL" />
<sql-case id="create_function_with_loop" value="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;" db-types="Oracle" />
+ <sql-case id="create_function_with_aggregate_using_function" value="CREATE
OR REPLACE EDITIONABLE FUNCTION MY_FUNC (P1 VARCHAR2) RETURN VARCHAR2 AGGREGATE
USING MY_AGG_FUNC;" db-types="Oracle" />
</sql-cases>