mysql_plugin.test fails when run in mysql-test RPM, though the build-time regression test is OK. This patch is from the pre-existing upstream bug report, except we also remove the part that tries to scribble on the read-only-to-us plugin directory. (That's not a terribly satisfactory solution, of course, but I'll leave it to upstream to find a better one.) rhbz #789530, upstream at http://bugs.mysql.com/bug.php?id=62907 diff -Naur mysql-5.5.21.orig/mysql-test/r/mysql_plugin.result mysql-5.5.21/mysql-test/r/mysql_plugin.result --- mysql-5.5.21.orig/mysql-test/r/mysql_plugin.result 2012-01-31 06:28:16.000000000 -0500 +++ mysql-5.5.21/mysql-test/r/mysql_plugin.result 2012-02-26 21:45:40.940840973 -0500 @@ -29,15 +29,6 @@ name dl daemon_example libdaemon_example.so # -# Ensure the plugin is replaced. -# -SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name; -name dl -daemon_example liblibdaemon_example.so -# -# Disable the plugin... -# -# # Ensure the plugin isn't loaded. # SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name; diff -Naur mysql-5.5.21.orig/mysql-test/t/mysql_plugin.test mysql-5.5.21/mysql-test/t/mysql_plugin.test --- mysql-5.5.21.orig/mysql-test/t/mysql_plugin.test 2012-01-31 06:28:15.000000000 -0500 +++ mysql-5.5.21/mysql-test/t/mysql_plugin.test 2012-02-26 21:50:43.973450081 -0500 @@ -24,7 +24,7 @@ # Add the datadir, basedir, plugin_dir to the bootstrap command let $MYSQLD_DATADIR= `select @@datadir`; -let $MYSQL_BASEDIR= `select @@basedir`; +let $MYSQLD_TMP_BASEDIR= $MYSQLTEST_VARDIR/tmp; let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`; let $PLUGIN_DIR=`select @@plugin_dir`; @@ -66,10 +66,10 @@ # 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 +--mkdir $MYSQLD_TMP_BASEDIR/share +--mkdir $MYSQLD_TMP_BASEDIR/share/mysql +--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_BASEDIR/share/errmsg.sys +--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_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 @@ -100,7 +100,7 @@ # Build client command for reuse. -let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR; +let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_TMP_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR; --echo # --echo # Ensure the plugin isn't loaded. @@ -198,52 +198,10 @@ --shutdown_server 10 --source include/wait_until_disconnected.inc -# To test the case where the same plugin is reloaded with a different soname, -# we must copy the example daemon to a new location renaming it. - -let $DAEMON_RELOAD = lib$DAEMONEXAMPLE; ---copy_file $PLUGIN_DIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD ---copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini - -# Now reload it and see that it is a different name. ---exec $MYSQL_PLUGIN_CMD ENABLE libdaemon_example - -# -# Restart the server -# ---append_file $expect_file -restart -EOF ---enable_reconnect ---source include/wait_until_connected_again.inc - ---echo # ---echo # Ensure the plugin is replaced. ---echo # ---replace_regex /\.dll/.so/ -SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name; - ---echo # ---echo # Disable the plugin... ---echo # -# MTR will remove this file later, but this might be too late. ---error 0,1 ---remove_file $expect_file ---write_file $expect_file -wait -EOF ---shutdown_server 10 ---source include/wait_until_disconnected.inc - # # Disable the plugin # ---exec $MYSQL_PLUGIN_CMD DISABLE libdaemon_example - -# Remove files for last test case. - ---remove_file $PLUGIN_DIR/$DAEMON_RELOAD ---remove_file $DAEMONEXAMPLE_DIR/libdaemon_example.ini +--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example # # Restart the server @@ -395,8 +353,10 @@ --remove_file $expect_file # Cleanup the share folder in the binary path. ---remove_file $MYSQLD_BASEDIR/share/errmsg.sys ---rmdir $MYSQLD_BASEDIR/share/mysql ---rmdir $MYSQLD_BASEDIR/share +--remove_file $MYSQLD_TMP_BASEDIR/share/errmsg.sys +--remove_file $MYSQLD_TMP_BASEDIR/share/mysql/errmsg.sys + +--rmdir $MYSQLD_TMP_BASEDIR/share/mysql +--rmdir $MYSQLD_TMP_BASEDIR/share --enable_abort_on_error