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

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

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
    • 10.2.35, 10.3.26, 10.4.16, 10.5.7
    • OTHER
    • None

    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

      Attachments

        Issue Links

          Activity

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

            sanja Oleksandr Byelkin added a comment - There is minor security problem with UDF first we check presence of UDF and only then rights to delete

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

            sanja Oleksandr Byelkin added a comment - Main problem with the case is that we remove UDF and SP with the same command.

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

            sanja Oleksandr Byelkin added a comment - commit 2792940391a17b6784f3d4dea2285a14356205ae (HEAD > bb-10.2 MDEV-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).

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

            sanja Oleksandr Byelkin added a comment - commit 5b86139118d8fe32b90caeaa4282edc2879cfcb5 (HEAD > bb-10.2 MDEV-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).

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

              sanja Oleksandr Byelkin
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.