From d1846e3b95c0bf75e0648e44136933e07f85f9fa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Oct 2011 15:30:28 -0400 Subject: BUG#12968815: mysql_plugin : disable requires plugin name but doesn't use it This patch corrects a defect in the building of the DELETE commands for disabling a plugin whereby only the original plugin data was deleted. If there were other plugins, the delete did not remove the rows. The code has been changed to remove all rows from the mysql.plugin table that were inserted when the plugin was loaded. The test has also been changed to correctly identify if all rows have been deleted. --- client/mysql_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/mysql_plugin.c') diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 825c962c486..dd5c02931c9 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -1081,7 +1081,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap) else { fprintf(file, - "DELETE FROM mysql.plugin WHERE name = '%s';", plugin_data.name); + "DELETE FROM mysql.plugin WHERE dl = '%s';", plugin_data.so_name); if (opt_verbose) { printf("# Disabling %s...\n", plugin_data.name); -- cgit v1.2.1 From 3c869a521ae17900fd60d67e5804f4a51cdec7cc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Oct 2011 15:33:54 -0400 Subject: BUG#12968567: mysql_plugin : incorrect return from bootstrap failure This patch corrects a defect whereby the bootstrap_server() method was returning 0 instead of the error code generated. The code has been changed to return the correct value returned from the bootstrap command. --- client/mysql_plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'client/mysql_plugin.c') diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index dd5c02931c9..55f5ea0827e 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -1160,7 +1160,6 @@ static int bootstrap_server(char *server_path, char *bootstrap_file) { char bootstrap_cmd[FN_REFLEN]; int error= 0; - int ret= 0; #ifdef __WIN__ char *format_str= 0; @@ -1196,7 +1195,7 @@ static int bootstrap_server(char *server_path, char *bootstrap_file) if (error) fprintf(stderr, "ERROR: Unexpected result from bootstrap. Error code: %d.\n", - ret); + error); return error; } -- cgit v1.2.1 From a2f757eabea5b38db5ffcaac10751bbb8475ff06 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Nov 2011 14:44:51 -0500 Subject: BUG#12929028: mysql_plugin : the --mysqld option is required, but not used This patch corrects a defect whereby the --mysqld, --my-print-defaults, and --plugin-ini were required. These options are not required and the code has been fixed accordingly. --- client/mysql_plugin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client/mysql_plugin.c') diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 55f5ea0827e..fb2a031bb8e 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -929,19 +929,19 @@ static int check_access() opt_datadir); goto exit; } - if ((error= my_access(opt_plugin_ini, F_OK))) + if (opt_plugin_ini && (error= my_access(opt_plugin_ini, F_OK))) { fprintf(stderr, "ERROR: Cannot access plugin config file at '%s'.\n", opt_plugin_ini); goto exit; } - if ((error= my_access(opt_mysqld, F_OK))) + if (opt_mysqld && (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))) + if (opt_my_print_defaults && (error= my_access(opt_my_print_defaults, F_OK))) { fprintf(stderr, "ERROR: Cannot access my-print-defaults path '%s'.\n", opt_my_print_defaults); @@ -967,7 +967,7 @@ static int find_tool(const char *tool_name, char *tool_path) int i= 0; const char *paths[]= { - opt_basedir, opt_mysqld, opt_my_print_defaults, "/usr", + opt_mysqld, opt_basedir, opt_my_print_defaults, "/usr", "/usr/local/mysql", "/usr/sbin", "/usr/share", "/extra", "/extra/debug", "/extra/release", "/bin", "/usr/bin", "/mysql/bin" }; @@ -1124,7 +1124,7 @@ static int dump_bootstrap_file(char *bootstrap_file) error= 1; goto exit; } - printf("# Query: %s", query_str); + printf("# Query: %s\n", query_str); exit: if (file) -- cgit v1.2.1