Commit d1846e3b authored by unknown's avatar unknown

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.
parent 7b4ebc16
...@@ -1081,7 +1081,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap) ...@@ -1081,7 +1081,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
else else
{ {
fprintf(file, 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) if (opt_verbose)
{ {
printf("# Disabling %s...\n", plugin_data.name); printf("# Disabling %s...\n", plugin_data.name);
......
# #
# Ensure the plugin isn't loaded. # Ensure the plugin isn't loaded.
# #
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
name dl name dl
# #
# Enable the plugin... # Enable the plugin...
# #
# #
# Simulate loading a plugin libary with multiple entry points.
# This will test the DISABLE to ensure all rows are removed.
#
INSERT INTO mysql.plugin VALUES ('wicky', 'libdaemon_example.so');
INSERT INTO mysql.plugin VALUES ('wacky', 'libdaemon_example.so');
INSERT INTO mysql.plugin VALUES ('wonky', 'libdaemon_example.so');
#
# Ensure the plugin is now loaded. # Ensure the plugin is now loaded.
# #
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
name dl name dl
daemon_example libdaemon_example.so daemon_example libdaemon_example.so
wacky libdaemon_example.so
wicky libdaemon_example.so
wonky libdaemon_example.so
# #
# Disable the plugin... # Disable the plugin...
# #
# #
# Ensure the plugin isn't loaded. # Ensure the plugin isn't loaded.
# #
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
name dl name dl
# #
# Attempt to load non-existant plugin # Attempt to load non-existant plugin
......
...@@ -105,7 +105,7 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD ...@@ -105,7 +105,7 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD
--echo # --echo #
--echo # Ensure the plugin isn't loaded. --echo # Ensure the plugin isn't loaded.
--echo # --echo #
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
--echo # --echo #
--echo # Enable the plugin... --echo # Enable the plugin...
...@@ -138,11 +138,19 @@ EOF ...@@ -138,11 +138,19 @@ EOF
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--echo #
--echo # Simulate loading a plugin libary with multiple entry points.
--echo # This will test the DISABLE to ensure all rows are removed.
--echo #
eval INSERT INTO mysql.plugin VALUES ('wicky', '$DAEMONEXAMPLE');
eval INSERT INTO mysql.plugin VALUES ('wacky', '$DAEMONEXAMPLE');
eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE');
--echo # --echo #
--echo # Ensure the plugin is now loaded. --echo # Ensure the plugin is now loaded.
--echo # --echo #
--replace_regex /\.dll/.so/ --replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
--echo # --echo #
--echo # Disable the plugin... --echo # Disable the plugin...
...@@ -173,7 +181,7 @@ EOF ...@@ -173,7 +181,7 @@ EOF
--echo # --echo #
--echo # Ensure the plugin isn't loaded. --echo # Ensure the plugin isn't loaded.
--echo # --echo #
SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
# #
# Stop the server for error conditions # Stop the server for error conditions
......
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