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

            hholzgra Hartmut Holzgraefe created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Fix Version/s 10.4 [ 22408 ]
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            hholzgra Hartmut Holzgraefe made changes -

            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?)
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            sanja Oleksandr Byelkin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]

            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...
            hholzgra Hartmut Holzgraefe made changes -
            Affects Version/s 10.1 [ 16100 ]
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.5 [ 23123 ]

            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
            hholzgra Hartmut Holzgraefe made changes -
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2.33 [ 24307 ]
            Fix Version/s 10.3.24 [ 24306 ]
            Fix Version/s 10.4.14 [ 24305 ]
            Fix Version/s 10.5.5 [ 24423 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 101740 ] MariaDB v4 [ 157072 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 193960 172155 120121

            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.