Commit 4fb57747 authored by Georgi Kodinov's avatar Georgi Kodinov

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.
parent aa624daf
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment