Skip to content

Commit

Permalink
sql: add logic test for function dropped by drop_owned_by
Browse files Browse the repository at this point in the history
With DROP FUNCTION supported in declarative schema changer,
DROP OWNED BY can now drop functions.

Release note: None
  • Loading branch information
chengxiong-ruan committed Jan 27, 2023
1 parent b23943c commit d83102f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/drop_owned_by
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,20 @@ GRANT SYSTEM MODIFYCLUSTERSETTING TO testuser

statement error pq: cannot perform drop owned by if role has synthetic privileges; testuser has entries in system.privileges
DROP OWNED BY testuser

subtest drop_function

statement ok
CREATE USER u_drop_udf;

statement ok
CREATE FUNCTION f_drop_udf() RETURNS INT LANGUAGE SQL AS $$ SELECT 1 $$;

statement ok
ALTER FUNCTION f_drop_udf OWNER TO u_drop_udf;

statement ok
DROP OWNED BY u_drop_udf;

statement error pq: unknown function: f_drop_udf\(\): function undefined
SHOW CREATE FUNCTION f_drop_udf;

0 comments on commit d83102f

Please sign in to comment.