diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-07-29 21:54:24 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-10-11 12:30:41 +0200 |
commit | 5b86139118d8fe32b90caeaa4282edc2879cfcb5 (patch) | |
tree | 3bb6d8011b0b8c092124e9eba90330d1cb207105 /mysql-test | |
parent | 222e1b806ff93083a62f740f6d247f8081983592 (diff) | |
download | mariadb-git-bb-10.2-MDEV-23327.tar.gz |
MDEV-23327 Can't uninstall UDF if the implementation library file doesn't existbb-10.2-MDEV-23327
Made cleanup of DROP (udf) FUNCTION procedure and also check of mysql.func (not only loaded udf).
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/udf.result | 14 | ||||
-rw-r--r-- | mysql-test/t/udf.test | 22 |
2 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index 56bc2e26b2a..49768f6c514 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -479,3 +479,17 @@ myfunc_int(max(a) over (order by b) , b) drop view v1; drop function myfunc_int; drop table t1; +# +# MDEV-23327: Can't uninstall UDF if the implementation library +# file doesn't exist +# +insert into mysql.func values ("unexisting_udf", 0, "soname", "function"); +select * from mysql.func WHERE name='unexisting_udf'; +name ret dl type +unexisting_udf 0 soname function +DROP FUNCTION unexisting_udf; +select * from mysql.plugin WHERE name='unexisting_udf'; +name dl +DROP FUNCTION unexisting_udf; +ERROR 42000: FUNCTION test.unexisting_udf does not exist +# End of 10.2 tests diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 7cdff2b6000..07c7f599db7 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -541,3 +541,25 @@ select * from v1; drop view v1; drop function myfunc_int; drop table t1; + +--echo # +--echo # MDEV-23327: Can't uninstall UDF if the implementation library +--echo # file doesn't exist +--echo # + +# emulate brocken so/ddl udf +insert into mysql.func values ("unexisting_udf", 0, "soname", "function"); + +# check that we have the function "installed" +select * from mysql.func WHERE name='unexisting_udf'; + +# make attempt to drop the function +DROP FUNCTION unexisting_udf; + +# check that we have the plugin uninstalled +select * from mysql.plugin WHERE name='unexisting_udf'; + +--error ER_SP_DOES_NOT_EXIST +DROP FUNCTION unexisting_udf; + +--echo # End of 10.2 tests |