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

            hholzgra Hartmut Holzgraefe created issue -
            hholzgra Hartmut Holzgraefe made changes -
            Field Original Value New Value
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ]

            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).
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            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:

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


            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
            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:

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


            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
            serg Sergei Golubchik made changes -
            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:

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


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

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

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

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


            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
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]

            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).
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]

            ok to push

            serg Sergei Golubchik added a comment - ok to push
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Component/s OTHER [ 10125 ]
            Fix Version/s 10.2.35 [ 25022 ]
            Fix Version/s 10.3.26 [ 25021 ]
            Fix Version/s 10.4.16 [ 25020 ]
            Fix Version/s 10.5.7 [ 25019 ]
            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 Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 111781 ] MariaDB v4 [ 158160 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 184036

            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.