Bug #52737 plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe
Submitted: 10 Apr 2010 0:38 Modified: 22 Jul 2010 15:36
Reporter: Elena Stepanova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.3-m3, 5.5.4-m3 OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any
Tags: regression

[10 Apr 2010 0:38] Elena Stepanova
Description:
If server is started via mysqld_safe script, the plugin_dir is set in the command line to /usr/local/mysql/lib/plugin (or alike)
In previous version, it was set to a directory relative to the basedir.

Workaround is to pass the correct path explicitly as a command-line option.

How to repeat:
- Start server using mysqld_safe script;
- check @@plugin_dir variable (or the command line).

Suggested fix:
Patch suggested by Mats:

=== modified file 'scripts/mysqld_safe.sh'
--- scripts/mysqld_safe.sh 2010-03-14 20:11:19 +0000
+++ scripts/mysqld_safe.sh 2010-04-09 07:25:22 +0000
@@ -699,7 +699,7 @@

cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"

-plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}"
+plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/plugin}${PLUGIN_VARIANT}"

for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION"
[11 May 2010 13:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/107969

3038 Mats Kindahl	2010-05-11
      Bug #52737: plugin_dir is set to /usr/local/mysql/lib/plugin while starting
                  via mysqld_safe
      
      Plugin dir was set to a hard-coded path instead of relative the base dir.
      
      This patch fixes this by using a path relative the basedir instead of the
      plugin directory indicated by the configuration.
[11 May 2010 14:15] Joerg Bruehe
Proposed patch looks good to me, I didn't spot any issue.
I don't have a setup to test it, though.
[11 May 2010 16:08] Elena Stepanova
The patch looks good to me, also tried it over 5.5.3-m3 on Linux, with release and debug variants.
[20 May 2010 10:04] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100520100225-oe4iuu5kuzsx0knq) (version source revid:alik@sun.com-20100520100057-rmn5y3o3ij726bm7) (merge vers: 6.0.14-alpha) (pib:16)
[20 May 2010 10:05] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100520100041-rf8ujv598zf86wjt) (version source revid:alik@sun.com-20100520100041-rf8ujv598zf86wjt) (merge vers: 5.5.5-m3) (pib:16)
[20 May 2010 10:06] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100520100140-5bzrtadw4w419i3m) (version source revid:alik@sun.com-20100520100049-1njm09rkvnhmysnr) (pib:16)
[20 May 2010 15:48] Paul DuBois
Noted in 5.5.5, 6.0.14 changelogs.

mysqld_safe set plugin_dir using an absolute path name rather than a
path relative to basedir.
[20 May 2010 18:22] Paul DuBois
Revised changelog entry:

mysqld_safe set plugin_dir using a default path name rather than a
path depending on basedir.
[15 Jun 2010 20:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/111192

3096 Mats Kindahl	2010-06-15
      BUG#52737: plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe
      
      Incremental patch to fix plugin_dir from .../lib/plugin to .../lib/mysql/plugin.
[16 Jun 2010 9:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/111231

3028 Mats Kindahl	2010-06-16
      BUG#52737: plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe
      
      Incremental patch to fix plugin_dir from .../lib/plugin to .../lib/mysql/plugin.
[22 Jun 2010 13:08] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100622130139-u05awgya93zvbsop) (version source revid:alik@sun.com-20100622130139-u05awgya93zvbsop) (merge vers: 5.5.5-m3) (pib:16)
[26 Jun 2010 23:32] Elena Stepanova
In 5.5.5-m3 the folder location is still ...lib/plugin, so it does not match the new plugin-dir value that mysqld_safe provides.
[30 Jun 2010 11:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/112562

3085 Jonathan Perkin	2010-06-30
      bug#52737 plugin_dir is set to /usr/local/mysql/lib/plugin while
                starting via mysqld_safe
      
      Rather than hardcode the plugin directory, enhance mysql_config
      to fix plugin path when running a relocated install, and use it
      to provide the plugin directory to mysqld_safe.
[5 Jul 2010 6:17] Sveta Smirnova
Bug #54961 was marked as duplicate of this one.
[7 Jul 2010 18:50] Paul DuBois
Previous changelog entry still applies.
[19 Jul 2010 10:15] Bugs System
Pushed into 5.5.6-m3 (revid:build@mysql.com-20100719101001-0ykgx8ceoq7s458e) (version source revid:build@mysql.com-20100719101001-0ykgx8ceoq7s458e) (merge vers: 5.5.6-m3) (pib:16)
[23 Jul 2010 12:33] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100723121929-90e9zemk3jkr2ocy) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (pib:18)