Skip to content

Commit

Permalink
add e2e for drop function
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <[email protected]>
  • Loading branch information
stdrc committed Nov 17, 2024
1 parent 42fa721 commit f0488fc
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions e2e_test/udf/drop_function.slt
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f0488fc

Please sign in to comment.