[MDEV-23327] Can't uninstall UDF if the implementation library file doesn't exist Created: 2020-07-29  Updated: 2021-04-19  Resolved: 2020-10-19

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.35, 10.3.26, 10.4.16, 10.5.7

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Issue split
split from MDEV-21258 Can't uninstall plugin if the library... Closed

 Description   

When an installed UDF can't be loaded at startup as its .so file can't be found anymore,, the error log will contain warnings about not being able to load the function

[ERROR] Can't open shared library 'udf_test.so' (errno: 0, cannot open shared object file: No such file or directory)

but the function can't be removed with DROP FUNCTION:

MariaDB [(none)]> drop function foo;
ERROR 1305 (42000): FUNCTION (UDF) foo does not exist

It can only be removed by deleting the related row in the mysql.func table directly with

DELETE FROM mysql.func WHERE name='...'

It should be able to remove a function with DROP even if it couldn't initialize for whatever reason, including missing .so file



 Comments   
Comment by Oleksandr Byelkin [ 2020-07-29 ]

There is minor security problem with UDF first we check presence of UDF and only then rights to delete

Comment by Oleksandr Byelkin [ 2020-07-29 ]

Main problem with the case is that we remove UDF and SP with the same command.

Comment by Oleksandr Byelkin [ 2020-07-29 ]

commit 2792940391a17b6784f3d4dea2285a14356205ae (HEAD > bb-10.2MDEV-23327, origin/bb-10.2-MDEV-23327)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Wed Jul 29 21:54:24 2020 +0200

MDEV-23327 Can't uninstall UDF if the implementation library file doesn't exist

Made cleanup of DROP (udf) FUNCTION procedure and also check of mysql.func (not only loaded udf).

Comment by Oleksandr Byelkin [ 2020-10-11 ]

commit 5b86139118d8fe32b90caeaa4282edc2879cfcb5 (HEAD > bb-10.2MDEV-23327, origin/bb-10.2-MDEV-23327)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Wed Jul 29 21:54:24 2020 +0200

MDEV-23327 Can't uninstall UDF if the implementation library file doesn't exist

Made cleanup of DROP (udf) FUNCTION procedure and also check of mysql.func (not only loaded udf).

Comment by Sergei Golubchik [ 2020-10-18 ]

ok to push

Generated at Thu Feb 08 09:21:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.