[MDEV-21258] Can't uninstall plugin if the library file doesn't exist Created: 2019-12-09  Updated: 2021-04-19  Resolved: 2020-07-29

Status: Closed
Project: MariaDB Server
Component/s: Plugins
Affects Version/s: 10.1, 10.4.10, 10.2, 10.3
Fix Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5

Type: Bug Priority: Critical
Reporter: Hartmut Holzgraefe Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Issue split
split to MDEV-23327 Can't uninstall UDF if the implementa... Closed
Relates
relates to MDEV-22085 mysql_upgrade should check for unavai... Closed

 Description   

When an installed plugin can't be loaded at startup as its .so file can't be found anymore, e.g. after switching form MySQL to MariaDB with a MySQL-only plugin installed, or when having a deprecated plugin still installed and the .so removed due to a version upgrade, the error log will contain warnings about not being able to load the plugin, but the plugin can't be removed with UNINSTALL PLUGIN or UNINSTALL SONAME.

It can only be removed by deleting the related row in the mysql.plugin table direrctly with DELETE FROM mysql.plugin WHERE name='...'

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



 Comments   
Comment by Sergei Golubchik [ 2020-04-01 ]

I agree that UINSTALL PLUGIN should work. Just like DROP TABLE works if the table is corrupted.

Comment by Hartmut Holzgraefe [ 2020-07-20 ]

Same problem for DROP FUNCTION if the implementation .so is missing...

Should I add an extra MDEV for that, or is mentioning it here sufficient?

(Also I seem to remember some upcoming change to UDF loading anyway, away from CREATE/DROP FUNCTION towards INSTALL/UNINSTALL PLUGIN ... can't find any reference to this anymore though. Was that planned for 10.6?)

Comment by Oleksandr Byelkin [ 2020-07-27 ]

hholzgra Is it only 10.4 problem? (taking into account that you want to attach UDF here)

Comment by Oleksandr Byelkin [ 2020-07-27 ]

I see UNINSTALL PLUGIN even in 10.1, and doubts that there is no such problem...

Comment by Oleksandr Byelkin [ 2020-07-28 ]

Tking into account TTL of 10.1 I think it has no sens to fix it there.

Comment by Oleksandr Byelkin [ 2020-07-28 ]

Test suite for this bug:

--source include/not_windows.inc
--source include/not_embedded.inc
--source include/have_example_plugin.inc
let $PLUGIN_DIR=`select @@plugin_dir`;
 
# make copy of so file because other tests can use the so in parallel
--copy_file $PLUGIN_DIR/ha_example.so  $PLUGIN_DIR/ha_example2.so
 
INSTALL PLUGIN example SONAME 'ha_example2';
 
--remove_file $PLUGIN_DIR/ha_example2.so
 
# restart server otherwise it uninstall plugin with no problem because it is
# loaded
--source include/restart_mysqld.inc
 
# check that we have the plugin installed
select * from mysql.plugin WHERE name='example';
 
# make attempt to uninstall the plugin
UNINSTALL PLUGIN example;

Comment by Hartmut Holzgraefe [ 2020-07-29 ]

UDF related one is MDEV-23327

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