Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21258

Can't uninstall plugin if the library file doesn't exist

Details

    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

      Attachments

        Issue Links

          Activity

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

            serg Sergei Golubchik added a comment - I agree that UINSTALL PLUGIN should work. Just like DROP TABLE works if the table is corrupted.

            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?)

            hholzgra Hartmut Holzgraefe added a comment - 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?)

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

            sanja Oleksandr Byelkin added a comment - hholzgra Is it only 10.4 problem? (taking into account that you want to attach UDF here)

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

            sanja Oleksandr Byelkin added a comment - I see UNINSTALL PLUGIN even in 10.1, and doubts that there is no such problem...

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

            sanja Oleksandr Byelkin added a comment - Tking into account TTL of 10.1 I think it has no sens to fix it there.

            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;
            

            sanja Oleksandr Byelkin added a comment - 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;

            UDF related one is MDEV-23327

            hholzgra Hartmut Holzgraefe added a comment - UDF related one is MDEV-23327

            People

              sanja Oleksandr Byelkin
              hholzgra Hartmut Holzgraefe
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.