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

Client plugin dir not automatically determined

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • 5.5(EOL), 10.0(EOL), 10.1(EOL)
    • N/A
    • Scripts & Clients
    • None

    Description

      At least on Windows, server is always able to correctly determine correct client plugin dir, no matter if it is started from unpacked ZIP or in MSI. It finds mysql_home, as parent of the directory where mysqld.exe is located (using GetModuleFileName to get mysqld.exe's path), then it sets the plugin_dir as $mysql_home/lib/plugin.

      Clients do not have the same logic, so whenever I start

      mysql -usome_user 
      

      which needs client plugin, it dies with rather unspecific message , like below

      C:\work\gssapi\_CPack_Packages\win32\ZIP\mariadb-10.1.9-win32>bin\mysql -uwlad
      ERROR 2059 (HY000): Authentication plugin 'auth_gssapi_client' cannot be loaded: The operation completed successfully.
      

      Looking with ProcessMonitor, mysql.exe tries to load it from the hardcoded path PLUGINDIR
      C:\MariaDB10.1\lib\plugin. That path is btw almost never correct, as we're installing MSI by default into C:\Program Files\MariaDB 10.1 , or, for 32bit on x64, into C:\Program Files(x86)\MariaDB 10.1 , but this is a different story.

      It is a little awkward to start mysql.exe with "--plugin-dir=C:\Program Files(x86)\MariaDB 10.1\lib\plugin", and whatever the path needs to be for the unpacked ZIP.

      Ideally, every client that can load plugins would implement the same logic as server, i.e resolving default path as _ ../${INSTALL_PLUGIN_DIR}_ relative to the location of the client binary.

      Attachments

        Activity

          well, the bug is about being able to find plugin relative to current executable, because it is server's installer job to install our executables into bin and client plugins into lib/plugin. We can't do it right for any client, but for some we can.

          wlad Vladislav Vaintroub added a comment - well, the bug is about being able to find plugin relative to current executable, because it is server's installer job to install our executables into bin and client plugins into lib/plugin. We can't do it right for any client , but for some we can.

          This problem does not just affect Windows. It also affects binary tarball installations on Linux.

          GeoffMontee Geoff Montee (Inactive) added a comment - This problem does not just affect Windows. It also affects binary tarball installations on Linux.

          wlad,

          • what's the problem with arg[0] ?
          • environment variables were used before, I tried not to break the compatibility with existing scripts
          • ok, will use it in mysql client too
          serg Sergei Golubchik added a comment - wlad , what's the problem with arg[0] ? environment variables were used before, I tried not to break the compatibility with existing scripts ok, will use it in mysql client too

          It works for me for Windows for the server, anytime so I do not see any reason to fix what is not broken. If you like to fix it on Linux, on server, it is just fine, yet outside of the scope for this bug. I do not think Windows needs any fixing.
          If you can do something without extra bit of information which is arg[0], I would prefer to do it without extra bit of information, GetFullPathName always works correctly.

          wlad Vladislav Vaintroub added a comment - It works for me for Windows for the server, anytime so I do not see any reason to fix what is not broken. If you like to fix it on Linux, on server, it is just fine, yet outside of the scope for this bug. I do not think Windows needs any fixing. If you can do something without extra bit of information which is arg [0] , I would prefer to do it without extra bit of information, GetFullPathName always works correctly.

          I've downloaded a ZIP archive of MariaDB 10.6.5 for Windows, unzipped it (on desktop), started the server, installed auth_ed25519 plugin. Created a user that is authenticated via this plugin.

          After that no matter from where and how I invoked mysql.exe, I was always able to connect as long as the password was correct. Meaning mysql.exe was always able to find and load the client ed25519.dll plugin.

          serg Sergei Golubchik added a comment - I've downloaded a ZIP archive of MariaDB 10.6.5 for Windows, unzipped it (on desktop), started the server, installed auth_ed25519 plugin. Created a user that is authenticated via this plugin. After that no matter from where and how I invoked mysql.exe, I was always able to connect as long as the password was correct. Meaning mysql.exe was always able to find and load the client ed25519.dll plugin.

          People

            serg Sergei Golubchik
            wlad Vladislav Vaintroub
            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.