From f0488fc21e2241cc60a6848d14ab120dec0e71e2 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Mon, 18 Nov 2024 01:29:58 +0800 Subject: [PATCH] add e2e for `drop function` Signed-off-by: Richard Chien --- e2e_test/udf/drop_function.slt | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 e2e_test/udf/drop_function.slt diff --git a/e2e_test/udf/drop_function.slt b/e2e_test/udf/drop_function.slt new file mode 100644 index 0000000000000..8d7dcf82a6a90 --- /dev/null +++ b/e2e_test/udf/drop_function.slt @@ -0,0 +1,55 @@ +# https://github.com/risingwavelabs/risingwave/issues/17263 + +statement ok +create table t (a int, b int); + +statement ok +create function add(a int, b int) returns int language python as $$ +def add(a, b): + return a+b +$$; + +statement ok +create materialized view mv as select add(a, b) as c from t; + +statement error +drop function add; +---- +db error: ERROR: Failed to run the query + +Caused by: + Permission denied: PermissionDenied: function used by 1 other objects. + + +statement ok +drop materialized view mv; + +statement ok +drop function add; + + +statement ok +create function add(a int, b int) returns int language python as $$ +def add(a, b): + return a+b +$$; + +statement ok +create sink s as select add(a, b) as c from t with (connector = 'blackhole'); + +statement error +drop function add; +---- +db error: ERROR: Failed to run the query + +Caused by: + Permission denied: PermissionDenied: function used by 1 other objects. + +statement ok +drop sink s; + +statement ok +drop function add; + +statement ok +drop table t;