Commit 9709dd87 authored by Chuck Bell's avatar Chuck Bell

WL#5710 : enable and disable plugins

This patch corrects a problem found in PB. Some platforms have very
different locations for the mysql installation. The client was not
able to find either my_print_defaults or mysqld predictably.

The patch adds two new command options --mysqld and --my-print-defaults
which can be used to provide the location of mysqld and
my_print_defaults by providing the paths.

The patch also changes the concatenation of the soname extension to
fix a problem found on some Ubuntu systems.

The patch contains changes to the test to ensure it will run on all
platforms. A trap is set in the test to skip testing if the location
of mysqld, my_print_defaults, or the daemon_example.ini files cannot
be determined.
parent 600da42e
...@@ -35,7 +35,8 @@ static uint opt_verbose=0; ...@@ -35,7 +35,8 @@ static uint opt_verbose=0;
static uint opt_no_defaults= 0; static uint opt_no_defaults= 0;
static uint opt_print_defaults= 0; static uint opt_print_defaults= 0;
static char *opt_datadir=0, *opt_basedir=0, static char *opt_datadir=0, *opt_basedir=0,
*opt_plugin_dir=0, *opt_plugin_ini=0; *opt_plugin_dir=0, *opt_plugin_ini=0,
*opt_mysqld=0, *opt_my_print_defaults=0;
static char bootstrap[FN_REFLEN]; static char bootstrap[FN_REFLEN];
...@@ -66,6 +67,11 @@ static struct my_option my_long_options[] = ...@@ -66,6 +67,11 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"print-defaults", 'P', "Show default values from configuration file.", {"print-defaults", 'P', "Show default values from configuration file.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"mysqld", 'm', "Path to mysqld executable. Example: /sbin/temp1/mysql/bin",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"my-print-defaults", 'f', "Path to my_print_defaults executable. "
"Example: /source/temp11/extra",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', {"verbose", 'v',
"More verbose output; you can use this multiple times to get even more " "More verbose output; you can use this multiple times to get even more "
"verbose output.", "verbose output.",
...@@ -317,6 +323,7 @@ static int get_default_values() ...@@ -317,6 +323,7 @@ static int get_default_values()
int ret= 0; int ret= 0;
FILE *file= 0; FILE *file= 0;
bzero(tool_path, FN_REFLEN);
if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path))) if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path)))
goto exit; goto exit;
else else
...@@ -335,6 +342,10 @@ static int get_default_values() ...@@ -335,6 +342,10 @@ static int get_default_values()
snprintf(defaults_cmd, sizeof(defaults_cmd), format_str, snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
add_quotes(tool_path), add_quotes(defaults_file)); add_quotes(tool_path), add_quotes(defaults_file));
if (opt_verbose)
{
printf("# my_print_defaults found: %s\n", tool_path);
}
} }
#else #else
snprintf(defaults_cmd, sizeof(defaults_cmd), snprintf(defaults_cmd, sizeof(defaults_cmd),
...@@ -438,6 +449,14 @@ static void print_default_values(void) ...@@ -438,6 +449,14 @@ static void print_default_values(void)
{ {
printf("--plugin_ini=%s ", opt_plugin_ini); printf("--plugin_ini=%s ", opt_plugin_ini);
} }
if (opt_mysqld)
{
printf("--mysqld=%s ", opt_mysqld);
}
if (opt_my_print_defaults)
{
printf("--my_print_defaults=%s ", opt_my_print_defaults);
}
printf("\n"); printf("\n");
} }
...@@ -486,6 +505,12 @@ get_one_option(int optid, ...@@ -486,6 +505,12 @@ get_one_option(int optid,
case 'i': case 'i':
opt_plugin_ini= my_strdup(argument, MYF(MY_FAE)); opt_plugin_ini= my_strdup(argument, MYF(MY_FAE));
break; break;
case 'm':
opt_mysqld= my_strdup(argument, MYF(MY_FAE));
break;
case 'f':
opt_my_print_defaults= my_strdup(argument, MYF(MY_FAE));
break;
} }
return 0; return 0;
} }
...@@ -526,10 +551,11 @@ static int search_dir(const char * base_path, const char *tool_name, ...@@ -526,10 +551,11 @@ static int search_dir(const char * base_path, const char *tool_name,
const char *subdir, char *tool_path) const char *subdir, char *tool_path)
{ {
char new_path[FN_REFLEN]; char new_path[FN_REFLEN];
char source_path[FN_REFLEN];
strcpy(new_path, base_path); strcpy(source_path, base_path);
strcat(new_path, subdir); strcat(source_path, subdir);
fn_format(new_path, new_path, "", tool_name, MY_UNPACK_FILENAME); fn_format(new_path, tool_name, source_path, "", MY_UNPACK_FILENAME);
if (file_exists(new_path)) if (file_exists(new_path))
{ {
strcpy(tool_path, new_path); strcpy(tool_path, new_path);
...@@ -634,10 +660,10 @@ static int load_plugin_data(char *plugin_name, char *config_file) ...@@ -634,10 +660,10 @@ static int load_plugin_data(char *plugin_name, char *config_file)
} }
if (i == -1) // if first pass, read this line as so_name if (i == -1) // if first pass, read this line as so_name
{ {
/* save so_name */
plugin_data.so_name= my_strdup(line, MYF(MY_WME));
/* Add proper file extension for soname */ /* Add proper file extension for soname */
strcat((char *)plugin_data.so_name, FN_SOEXT); strcat(line, FN_SOEXT);
/* save so_name */
plugin_data.so_name= my_strdup(line, MYF(MY_WME|MY_ZEROFILL));
i++; i++;
} }
else else
...@@ -902,6 +928,18 @@ static int check_access() ...@@ -902,6 +928,18 @@ static int check_access()
opt_plugin_ini); opt_plugin_ini);
goto exit; goto exit;
} }
if ((error= my_access(opt_mysqld, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access mysqld path '%s'.\n",
opt_mysqld);
goto exit;
}
if ((error= my_access(opt_my_print_defaults, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access my-print-defaults path '%s'.\n",
opt_my_print_defaults);
goto exit;
}
exit: exit:
return error; return error;
...@@ -922,9 +960,9 @@ static int find_tool(const char *tool_name, char *tool_path) ...@@ -922,9 +960,9 @@ static int find_tool(const char *tool_name, char *tool_path)
int i= 0; int i= 0;
const char *paths[]= { const char *paths[]= {
opt_basedir, "/usr", "/usr/local/mysql", "/usr/sbin", "/usr/share", opt_basedir, opt_mysqld, opt_my_print_defaults, "/usr",
"/extra", "/extra/debug", "/extra/release", "/bin", "/usr/bin", "/usr/local/mysql", "/usr/sbin", "/usr/share", "/extra", "/extra/debug",
"/mysql/bin" "/extra/release", "/bin", "/usr/bin", "/mysql/bin"
}; };
for (i= 0; i < (int)array_elements(paths); i++) for (i= 0; i < (int)array_elements(paths); i++)
{ {
......
...@@ -49,6 +49,14 @@ ERROR: Cannot access basedir at '/basedir_not_there/'. ...@@ -49,6 +49,14 @@ ERROR: Cannot access basedir at '/basedir_not_there/'.
# #
ERROR: Cannot read plugin config file daemon_example. File does not exist. ERROR: Cannot read plugin config file daemon_example. File does not exist.
# #
# Attempt to use bad paths - mysqld
#
ERROR: Cannot access mysqld path '/mysqld_not_there/'.
#
# Attempt to use bad paths - my_print_defaults
#
ERROR: Cannot access my-print-defaults path '/my_print_defaults_not_there/'.
#
# Missing library # Missing library
# #
ERROR: The plugin library is missing or in a different location. ERROR: The plugin library is missing or in a different location.
...@@ -90,6 +98,10 @@ Options: ...@@ -90,6 +98,10 @@ Options:
-n, --no-defaults Do not read values from configuration file. -n, --no-defaults Do not read values from configuration file.
-P, --print-defaults -P, --print-defaults
Show default values from configuration file. Show default values from configuration file.
-m, --mysqld=name Path to mysqld executable. Example: /sbin/temp1/mysql/bin
-f, --my-print-defaults=name
Path to my_print_defaults executable. Example:
/source/temp11/extra
-v, --verbose More verbose output; you can use this multiple times to -v, --verbose More verbose output; you can use this multiple times to
get even more verbose output. get even more verbose output.
-V, --version Output version information and exit. -V, --version Output version information and exit.
......
# #
# Test mysql_plugin tool # Test mysql_plugin tool
# #
# This test contains test cases for testing the mysql_plugin client with
# the daemon_example plugin. Test cases include tests for:
#
# - successful enable/disable
# - incorrect paths
# - missing paths/options
#
# Implementation Notes
#
# The mysql_plugin tool now accepts --mysqld the path to mysqld server. The
# mysqld path is extracted from MYSQLD_BOOTSTRAP_CMD line. We also extract
# the path of MYSQLD_BASEDIR (where mysql exists) and use it for the errmsg
# file. The directories differ between Windows and Unix but the Perl script
# included below will pick as per platform.
#
# The test is also designed to issue the --skip directive if the location of
# the mysqld, my_print_defaults, or daemon_example.ini files cannot be found.
#
--source include/not_embedded.inc --source include/not_embedded.inc
# Add the datadir, basedir, plugin_dir to the bootstrap command # Add the datadir, basedir, plugin_dir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQL_BASEDIR= `select @@basedir`; let $MYSQL_BASEDIR= `select @@basedir`;
let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
let $PLUGIN_DIR=`select @@plugin_dir`;
# The mysql_plugin tool expects all executables in "basedir", so they will be copied to it.
# It also expects a directory structure like in the installed mysql version, so errmsg.sys
# will be copied to "basedir/share". The directories differ between Windows and Unix.
--disable_abort_on_error --disable_abort_on_error
if(`SELECT CONVERT(@@version_compile_os USING latin1)
IN ('Win32','Win64','Windows')`) # Perl script to extract the location of the basedir from environment
# variables. This is needed to ensure the test will run on the PB machines
# designed to test release as well as debug builds. It also checks for the
# location of the my_print_defaults and daemon_example.ini files.
perl;
use File::Basename;
my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
my $mysqld_basedir=dirname($mysqld);
my $my_print_defaults= $ENV{MYSQL_MY_PRINT_DEFAULTS};
my $my_print_defaults_basedir=dirname($my_print_defaults);
my $daemonexample_ini= "$ENV{DAEMONEXAMPLE_DIR}/daemon_example.ini";
my $plugindir_ini= "$ENV{PLUGIN_DIR}/daemon_example.ini";
my $notfound= "";
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
if ((!-e $daemonexample_ini) || (!-r $daemonexample_ini))
{
print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
}
if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
{
print FILE "let \$PLUGIN_DIR= $not_found;\n";
}
close FILE;
EOF
source $MYSQL_TMP_DIR/mysqld.inc;
remove_file $MYSQL_TMP_DIR/mysqld.inc;
# The mysql_plugin tool expects a directory structure like in the installed
# mysql version, so errmsg.sys will be copied to "basedir/share", we create
# and remove this structure.
--mkdir $MYSQLD_BASEDIR/share
--mkdir $MYSQLD_BASEDIR/share/mysql
--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/mysql/errmsg.sys
# The mysql_plugin tool now accepts --my-print-defaults which points to the
# executable my_print_defaults.exe we can get this path from the variable
# $MYSQL_MY_PRINT_DEFAULTS.
# Check for my_print_defaults location. Skip if not found.
if ($MYSQL_MY_PRINT_DEFAULTS_BASEDIR == '')
{
--skip Test requires known location of my_print_defaults executable.
}
# Check for mysqld location. Skip if not found.
if ($MYSQLD == '')
{ {
let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/sql/Debug; --skip Test requires known location of mysqld executable.
--copy_file $MYSQL_BASEDIR/extra/Debug/my_print_defaults.exe $MYSQLD_BASEDIR/my_print_defaults.exe
--mkdir $MYSQLD_BASEDIR/share
--copy_file $MYSQL_BASEDIR/sql/share/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
--copy_file $MYSQL_BASEDIR/plugin/daemon_example/daemon_example.ini $DAEMONEXAMPLE_DIR/daemon_example.ini
} }
if (`SELECT CONVERT(@@version_compile_os USING latin1)
NOT IN ('Win32','Win64','Windows')`) # Check for daemon_example.ini location. Skip if not found in either
# the plugin_dir path or the daemon_example_dir path.
if ($PLUGIN_DIR == '')
{ {
let $MYSQLD_BASEDIR= $MYSQL_BASEDIR/sql; if ($DAEMONEXAMPLE_DIR == '')
--copy_file $MYSQL_BASEDIR/extra/my_print_defaults $MYSQLD_BASEDIR/my_print_defaults {
--copy_file $MYSQL_BASEDIR/sql/share/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys --skip Test requires known location of daemon_example.ini file.
}
let $PLUGIN_DIR = $DAEMONEXAMPLE_DIR;
} }
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR; # Build client command for reuse.
let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--echo # --echo #
--echo # Ensure the plugin isn't loaded. --echo # Ensure the plugin isn't loaded.
...@@ -52,11 +124,11 @@ EOF ...@@ -52,11 +124,11 @@ EOF
# #
# Enable the plugin # Enable the plugin
# #
--exec $MYSQLD_BOOTSTRAP_CMD ENABLE daemon_example --exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
# #
# Ensure enabling an enabled plugin doesn't fail # Ensure enabling an enabled plugin doesn't fail
--exec $MYSQLD_BOOTSTRAP_CMD ENABLE daemon_example --exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
# #
# Restart the server # Restart the server
...@@ -88,7 +160,7 @@ EOF ...@@ -88,7 +160,7 @@ EOF
# #
# Disable the plugin # Disable the plugin
# #
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example
# #
# Restart the server # Restart the server
...@@ -121,81 +193,96 @@ EOF ...@@ -121,81 +193,96 @@ EOF
--echo # Attempt to load non-existant plugin --echo # Attempt to load non-existant plugin
--echo # --echo #
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE NOT_THERE_AT_ALL 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE NOT_THERE_AT_ALL 2>&1
--echo # --echo #
--echo # Attempt to use non-existant plugin.ini file --echo # Attempt to use non-existant plugin.ini file
--echo # --echo #
--error 1,2,7,256 --error 1,2,7,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example --plugin-ini=/NOT/THERE/pi.ini 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example --plugin-ini=/NOT/THERE/pi.ini 2>&1
--echo # --echo #
--echo # Attempt to omit the plugin --echo # Attempt to omit the plugin
--echo # --echo #
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE 2>&1
--echo # --echo #
--echo # Attempt to omit DISABLE|ENABLE --echo # Attempt to omit DISABLE|ENABLE
--echo # --echo #
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD daemon_example 2>&1
--echo # --echo #
--echo # Attempt to use bad paths - datadir --echo # Attempt to use bad paths - datadir
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Attempt to use bad paths - basedir --echo # Attempt to use bad paths - basedir
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$DAEMONEXAMPLE_DIR; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Attempt to use bad paths - plugin_dir --echo # Attempt to use bad paths - plugin_dir
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=/plugin_not_there/; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=/plugin_not_there/ --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256
--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo #
--echo # Attempt to use bad paths - mysqld
--echo #
let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=/mysqld_not_there/ --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256
--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo #
--echo # Attempt to use bad paths - my_print_defaults
--echo #
let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=/my_print_defaults_not_there/;
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Missing library --echo # Missing library
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Bad format for config file --echo # Bad format for config file
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,256 --error 1,2,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Missing base_dir option --echo # Missing base_dir option
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$DAEMONEXAMPLE_DIR; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,139,256 --error 1,2,139,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Missing data_dir option --echo # Missing data_dir option
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQLD_BASEDIR --plugin-dir=$DAEMONEXAMPLE_DIR; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,139,256 --error 1,2,139,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Missing plugin_dir option --echo # Missing plugin_dir option
--echo # --echo #
let $MYSQLD_BOOTSTRAP_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR; let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQL_BASEDIR --mysqld=$MYSQLD --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
--error 1,2,139,256 --error 1,2,139,256
--exec $MYSQLD_BOOTSTRAP_CMD DISABLE daemon_example 2>&1 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
--echo # --echo #
--echo # Show the help. --echo # Show the help.
...@@ -223,18 +310,9 @@ EOF ...@@ -223,18 +310,9 @@ EOF
--error 0,1 --error 0,1
--remove_file $expect_file --remove_file $expect_file
if(`SELECT CONVERT(@@version_compile_os USING latin1) # Cleanup the share folder in the binary path.
IN ('Win32','Win64','Windows')`) --remove_file $MYSQLD_BASEDIR/share/errmsg.sys
{ --rmdir $MYSQLD_BASEDIR/share/mysql
--remove_file $DAEMONEXAMPLE_DIR/daemon_example.ini --rmdir $MYSQLD_BASEDIR/share
--remove_file $MYSQLD_BASEDIR/my_print_defaults.exe
--remove_file $MYSQLD_BASEDIR/share/errmsg.sys
--rmdir $MYSQLD_BASEDIR/share
}
if(`SELECT CONVERT(@@version_compile_os USING latin1)
NOT IN ('Win32','Win64','Windows')`)
{
--remove_file $MYSQLD_BASEDIR/my_print_defaults
--remove_file $MYSQLD_BASEDIR/share/errmsg.sys
}
--enable_abort_on_error --enable_abort_on_error
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