Blame SOURCES/mysql-plugin-test.patch

6f9931
mysql_plugin.test fails when run in mysql-test RPM, though the build-time
6f9931
regression test is OK.  This patch is from the pre-existing upstream bug
6f9931
report, except we also fix the part that tries to scribble on the
6f9931
read-only-to-us plugin directory.
6f9931
6f9931
rhbz #789530, upstream at http://bugs.mysql.com/bug.php?id=62907
6f9931
6f9931
6f9931
diff -up mysql-5.5.31/mysql-test/t/mysql_plugin-master.opt.p17 mysql-5.5.31/mysql-test/t/mysql_plugin-master.opt
6f9931
--- mysql-5.5.31/mysql-test/t/mysql_plugin-master.opt.p17	2013-03-25 14:14:58.000000000 +0100
6f9931
+++ mysql-5.5.31/mysql-test/t/mysql_plugin-master.opt	2013-04-19 13:38:23.761741532 +0200
6f9931
@@ -1 +1 @@
6f9931
---plugin-dir=$DAEMONEXAMPLE_DIR
6f9931
+--plugin-dir=$MYSQLTEST_VARDIR/plugin
6f9931
diff -up mysql-5.5.31/mysql-test/t/mysql_plugin.test.p17 mysql-5.5.31/mysql-test/t/mysql_plugin.test
6f9931
--- mysql-5.5.31/mysql-test/t/mysql_plugin.test.p17	2013-03-25 14:14:58.000000000 +0100
6f9931
+++ mysql-5.5.31/mysql-test/t/mysql_plugin.test	2013-04-19 13:38:25.606742145 +0200
6f9931
@@ -25,8 +25,10 @@
6f9931
 # Add the datadir, basedir, plugin_dir to the bootstrap command
6f9931
 let $MYSQLD_DATADIR= `select @@datadir`;
6f9931
 let $MYSQL_BASEDIR= `select @@basedir`;
6f9931
+let $MYSQLD_TMP_BASEDIR= $MYSQLTEST_VARDIR/tmp;
6f9931
 let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
6f9931
 let $PLUGIN_DIR=`select @@plugin_dir`;
6f9931
+let $PLUGIN_BASEDIR=$DAEMONEXAMPLE_DIR;
6f9931
 
6f9931
 --disable_abort_on_error
6f9931
 
6f9931
@@ -51,10 +53,11 @@ use File::Basename;
6f9931
   {
6f9931
     print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
6f9931
   }
6f9931
-  if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
6f9931
-  {
6f9931
-    print FILE "let \$PLUGIN_DIR= $not_found;\n";
6f9931
-  }
6f9931
+# This test doesn't work because $ENV{PLUGIN_DIR} is empty
6f9931
+#  if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
6f9931
+#  {
6f9931
+#    print FILE "let \$PLUGIN_DIR= $not_found;\n";
6f9931
+#  }
6f9931
   close FILE;
6f9931
 EOF
6f9931
 
6f9931
@@ -66,10 +69,14 @@ remove_file $MYSQL_TMP_DIR/mysqld.inc;
6f9931
 # mysql version, so errmsg.sys will be copied to "basedir/share", we create
6f9931
 # and remove this structure. 
6f9931
 
6f9931
---mkdir $MYSQLD_BASEDIR/share
6f9931
---mkdir $MYSQLD_BASEDIR/share/mysql
6f9931
---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
6f9931
---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/mysql/errmsg.sys
6f9931
+--mkdir $MYSQLD_TMP_BASEDIR/share
6f9931
+--mkdir $MYSQLD_TMP_BASEDIR/share/mysql
6f9931
+--mkdir $PLUGIN_DIR
6f9931
+--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_BASEDIR/share/errmsg.sys
6f9931
+--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_BASEDIR/share/mysql/errmsg.sys
6f9931
+--copy_file $PLUGIN_BASEDIR/libdaemon_example.so $PLUGIN_DIR/libdaemon_example.so
6f9931
+--copy_file $PLUGIN_BASEDIR/daemon_example.ini $PLUGIN_DIR/daemon_example.ini
6f9931
+
6f9931
 
6f9931
 # The mysql_plugin tool now accepts --my-print-defaults which points to the
6f9931
 # executable my_print_defaults.exe we can get this path from the variable
6f9931
@@ -100,7 +107,7 @@ if ($PLUGIN_DIR == '')
6f9931
 
6f9931
 # Build client command for reuse.
6f9931
 
6f9931
-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;
6f9931
+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;
6f9931
 
6f9931
 --echo #
6f9931
 --echo # Ensure the plugin isn't loaded.
6f9931
@@ -184,7 +191,7 @@ SELECT * FROM mysql.plugin WHERE dl like
6f9931
 # we must copy the example daemon to a new location renaming it.
6f9931
 
6f9931
 let $DAEMON_RELOAD = lib$DAEMONEXAMPLE;
6f9931
---copy_file $PLUGIN_DIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
6f9931
+--copy_file $PLUGIN_BASEDIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
6f9931
 --copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini
6f9931
 
6f9931
 # Now reload it and see that it is a different name.
6f9931
@@ -361,8 +368,11 @@ replace_result $MYSQL_PLUGIN mysql_plugi
6f9931
 --remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
6f9931
 
6f9931
 # Cleanup the share folder in the binary path.
6f9931
---remove_file $MYSQLD_BASEDIR/share/errmsg.sys
6f9931
---rmdir $MYSQLD_BASEDIR/share/mysql
6f9931
---rmdir $MYSQLD_BASEDIR/share
6f9931
+--remove_file $PLUGIN_DIR/daemon_example.ini
6f9931
+--remove_file $PLUGIN_DIR/libdaemon_example.so
6f9931
+--rmdir $PLUGIN_DIR
6f9931
+--remove_file $MYSQLD_TMP_BASEDIR/share/errmsg.sys
6f9931
+--rmdir $MYSQLD_TMP_BASEDIR/share/mysql
6f9931
+--rmdir $MYSQLD_TMP_BASEDIR/share
6f9931
 
6f9931
 --enable_abort_on_error