diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2012-08-27 15:30:58 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2012-08-27 15:30:58 +0300 |
commit | 4fb57747fe90a148c25089f813bba56cbd230aeb (patch) | |
tree | eede1e5a01d878fb5624707056cbb9cc29ab12b2 /scripts | |
parent | aa624daf8be6d826398020913f859adcf6159f2c (diff) | |
download | mariadb-git-4fb57747fe90a148c25089f813bba56cbd230aeb.tar.gz |
Bug #13548161: MYSQLD_SAFE IMPROVEMENTS FOR 5.5 ALLWAYS SETS PLUGIN_DIR
TO DEFAULT IGNOR
The test in mysqld_safe for the presence of the --plugin-dir and assigning a default
value to it were performed before the actual argument parsing.
This is wrong, as PLUGIN_DIR mysqld_safe code also uses MY_BASEDIR_VERSION to
look for version specific plugin directory if present.
Fixed by moving the PLUGIN_DIR logic after the parse_arguments() call.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_safe.sh | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 37e0e351ccd..1f67e2fe271 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -413,29 +413,6 @@ else DATADIR=@localstatedir@ fi -# -# Try to find the plugin directory -# - -# Use user-supplied argument -if [ -n "${PLUGIN_DIR}" ]; then - plugin_dir="${PLUGIN_DIR}" -else - # Try to find plugin dir relative to basedir - for dir in lib/mysql/plugin lib/plugin - do - if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then - plugin_dir="${MY_BASEDIR_VERSION}/${dir}" - break - fi - done - # Give up and use compiled-in default - if [ -z "${plugin_dir}" ]; then - plugin_dir='@pkgplugindir@' - fi -fi -plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" - if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" @@ -496,6 +473,31 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" + +# +# Try to find the plugin directory +# + +# Use user-supplied argument +if [ -n "${PLUGIN_DIR}" ]; then + plugin_dir="${PLUGIN_DIR}" +else + # Try to find plugin dir relative to basedir + for dir in lib/mysql/plugin lib/plugin + do + if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then + plugin_dir="${MY_BASEDIR_VERSION}/${dir}" + break + fi + done + # Give up and use compiled-in default + if [ -z "${plugin_dir}" ]; then + plugin_dir='@pkgplugindir@' + fi +fi +plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" + + # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested |