-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Previously, we blocked the ability of one UDF to call another UDF due to a lack of dependency tracking. This patch removes this limitation by allowing user-defined functions to reference other user-defined functions in their bodies. Informs: cockroachdb#88198 Release note: None
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
statement ok | ||
CREATE FUNCTION lower_hello() RETURNS STRING LANGUAGE SQL AS $$ SELECT lower('hello') $$; | ||
|
||
statement ok | ||
CREATE FUNCTION upper_hello() RETURNS STRING LANGUAGE SQL AS $$ SELECT upper(lower_hello()) $$; | ||
|
||
statement ok | ||
CREATE FUNCTION nested_udf_for_from() RETURNS STRING LANGUAGE SQL AS $$ SELECT * FROM upper_hello()$$; | ||
|
||
statement ok | ||
CREATE FUNCTION concat_hello() RETURNS STRING LANGUAGE SQL AS $$ SELECT upper(lower_hello()) || upper_hello() || lower_hello() $$; | ||
|
||
query TTTT | ||
SELECT upper_hello(), nested_udf_for_from(), lower_hello(), concat_hello() | ||
---- | ||
HELLO HELLO hello HELLOHELLOhello | ||
|
||
# Validate recursion doesn't work today. | ||
statement error pgcode 42883 unknown function: recursion_check\(\) | ||
CREATE FUNCTION recursion_check() RETURNS STRING LANGUAGE SQL AS $$ SELECT recursion_check() $$; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.