[mysql] Revise mysql_plugin test patch which moves plugin files to a temporary directory now Resolves: #7895

Jan Horak hhorak at fedoraproject.org
Tue Mar 20 16:23:13 UTC 2012


commit 989dfb7eb5d474a29a13014ddbc3afb0274a7a38
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date:   Tue Mar 20 17:22:41 2012 +0100

    Revise mysql_plugin test patch which moves plugin files to a temporary directory now
    Resolves: #789530

 mysql-plugin-test.patch |  136 ++++++++++++++++-------------------------------
 mysql.spec              |    7 ++-
 2 files changed, 52 insertions(+), 91 deletions(-)
---
diff --git a/mysql-plugin-test.patch b/mysql-plugin-test.patch
index c2fbd0c..51c8328 100644
--- a/mysql-plugin-test.patch
+++ b/mysql-plugin-test.patch
@@ -1,44 +1,40 @@
-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 @@
- 
+diff -up mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt
+--- mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin	2012-01-31 12:28:15.000000000 +0100
++++ mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt	2012-03-14 16:54:19.060951822 +0100
+@@ -1 +1 @@
+---plugin-dir=$DAEMONEXAMPLE_DIR
++--plugin-dir=$MYSQLTEST_VARDIR/plugin
+diff -up mysql-5.5.21/mysql-test/t/mysql_plugin.test.plugin mysql-5.5.21/mysql-test/t/mysql_plugin.test
+--- mysql-5.5.21/mysql-test/t/mysql_plugin.test.plugin	2012-01-31 12:28:15.000000000 +0100
++++ mysql-5.5.21/mysql-test/t/mysql_plugin.test	2012-03-14 17:11:40.769295981 +0100
+@@ -25,8 +25,10 @@
  # Add the datadir, basedir, plugin_dir to the bootstrap command
  let $MYSQLD_DATADIR= `select @@datadir`;
--let $MYSQL_BASEDIR= `select @@basedir`;
+ 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`;
++let $PLUGIN_BASEDIR=$DAEMONEXAMPLE_DIR;
+ 
+ --disable_abort_on_error
+ 
+@@ -51,10 +53,11 @@ use File::Basename;
+   {
+     print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
+   }
+-  if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
+-  {
+-    print FILE "let \$PLUGIN_DIR= $not_found;\n";
+-  }
++# This test doesn't work because $ENV{PLUGIN_DIR} is empty
++#  if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
++#  {
++#    print FILE "let \$PLUGIN_DIR= $not_found;\n";
++#  }
+   close FILE;
+ EOF
  
-@@ -66,10 +66,10 @@
+@@ -66,10 +69,14 @@ remove_file $MYSQL_TMP_DIR/mysqld.inc;
  # mysql version, so errmsg.sys will be copied to "basedir/share", we create
  # and remove this structure. 
  
@@ -48,12 +44,16 @@ diff -Naur mysql-5.5.21.orig/mysql-test/t/mysql_plugin.test mysql-5.5.21/mysql-t
 ---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
++--mkdir $PLUGIN_DIR
 +--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
++--copy_file $PLUGIN_BASEDIR/libdaemon_example.so $PLUGIN_DIR/libdaemon_example.so
++--copy_file $PLUGIN_BASEDIR/daemon_example.ini $PLUGIN_DIR/daemon_example.ini
++
  
  # 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 @@
+@@ -100,7 +107,7 @@ if ($PLUGIN_DIR == '')
  
  # Build client command for reuse.
  
@@ -62,70 +62,26 @@ diff -Naur mysql-5.5.21.orig/mysql-test/t/mysql_plugin.test mysql-5.5.21/mysql-t
  
  --echo #
  --echo # Ensure the plugin isn't loaded.
-@@ -198,52 +198,10 @@
- --shutdown_server 10
- --source include/wait_until_disconnected.inc
+@@ -202,7 +209,7 @@ EOF
+ # we must copy the example daemon to a new location renaming it.
  
--# 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;
+ 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
++--copy_file $PLUGIN_BASEDIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
+ --copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini
  
- #
- # Restart the server
-@@ -395,8 +353,10 @@
+ # Now reload it and see that it is a different name.
+@@ -395,8 +402,11 @@ EOF
  --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 $PLUGIN_DIR/daemon_example.ini
++--remove_file $PLUGIN_DIR/libdaemon_example.so
++--rmdir $PLUGIN_DIR
 +--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
  
diff --git a/mysql.spec b/mysql.spec
index 47a7024..8f4af2a 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -1,6 +1,6 @@
 Name: mysql
 Version: 5.5.21
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 Summary: MySQL client programs and shared libraries
 Group: Applications/Databases
@@ -693,6 +693,11 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Tue Mar 20 2012 Honza Horak <hhorak at redhat.com> 5.5.21-3
+- Revise mysql_plugin test patch which moves plugin files to 
+  a temporary directory now
+Resolves: #789530
+
 * Tue Mar 13 2012 Honza Horak <hhorak at redhat.com> 5.5.21-2
 - Fix ssl-related tests to specify expected cipher explicitly
 Related: #789600


More information about the scm-commits mailing list