Bug #64931 federated_plugin test case fail on 64bit architectures
Submitted: 10 Apr 2012 16:06 Modified: 15 Jun 2012 3:19
Reporter: Honza Horak (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1.61 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Contribution

[10 Apr 2012 16:06] Honza Horak
Description:
Running federated_plugin test case we get the following error:

error:federated.federated_plugin               [ fail ]
        Test ended at 2012-04-10 17:56:23

CURRENT_TEST: federated.federated_plugin
mysqltest: At line 18: query 'INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN'' failed: 1126: Can't open shared library '/usr//ha_federated.so' (errno: 2 cannot open shared object file: No such file or directory)

The result from queries just before the failure was:
CREATE TABLE t2(a int);
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
Warnings:
Warning	1286	Unknown table engine 'FEDERATED'
Warning	1266	Using storage engine MyISAM for table 't1'
DROP TABLE t1;

 - saving '/usr/share/mysql-test/var/log/federated.federated_plugin/' to '/usr/share/mysql-test/var/log/federated.federated_plugin/'

How to repeat:
Run ./mysql-test-run --do-test=federated_plugin on 64bit architecture.

Suggested fix:
diff -up mysql-5.1.61/mysql-test/mysql-test-run.pl.plugindir mysql-5.1.61/mysql-test/mysql-test-run.pl
--- mysql-5.1.61/mysql-test/mysql-test-run.pl.plugindir 2012-04-10 17:49:50.075727275 +0200
+++ mysql-5.1.61/mysql-test/mysql-test-run.pl   2012-04-10 17:50:59.948790478 +0200
@@ -1969,7 +1969,8 @@ sub environment_setup {
     my $lib_example_plugin=
       mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
                      "$basedir/storage/example/.libs/".$plugin_filename,
-                      "$basedir/lib/mysql/plugin/".$plugin_filename);
+                      "$basedir/lib/mysql/plugin/".$plugin_filename,
+                      "$basedir/lib64/mysql/plugin/".$plugin_filename);
     $ENV{'EXAMPLE_PLUGIN'}=
       ($lib_example_plugin ? basename($lib_example_plugin) : "");
     $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
@@ -1991,7 +1992,8 @@ sub environment_setup {
   my $lib_fed_plugin=
     mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename),
                    "$basedir/storage/federated/.libs/".$fedplug_filename,
-                   "$basedir/lib/mysql/plugin/".$fedplug_filename);
+                   "$basedir/lib/mysql/plugin/".$fedplug_filename,
+                   "$basedir/lib64/mysql/plugin/".$fedplug_filename);
 
   $ENV{'FEDERATED_PLUGIN'}= $fedplug_filename;
   $ENV{'FEDERATED_PLUGIN_DIR'}=
[10 Apr 2012 16:25] Honza Horak
I forgot to patch mysql-test-run as well, so this is a complete patch.

diff -up mysql-5.1.61/mysql-test/mysql-test-run.pl.plugindir mysql-5.1.61/mysql-test/mysql-test-r
un.pl
--- mysql-5.1.61/mysql-test/mysql-test-run.pl.plugindir 2011-12-16 20:05:59.000000000 +0100
+++ mysql-5.1.61/mysql-test/mysql-test-run.pl   2012-04-10 17:57:07.343129371 +0200
@@ -1969,7 +1969,8 @@ sub environment_setup {
     my $lib_example_plugin=
       mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
                      "$basedir/storage/example/.libs/".$plugin_filename,
-                      "$basedir/lib/mysql/plugin/".$plugin_filename);
+                      "$basedir/lib/mysql/plugin/".$plugin_filename,
+                      "$basedir/lib64/mysql/plugin/".$plugin_filename);
     $ENV{'EXAMPLE_PLUGIN'}=
       ($lib_example_plugin ? basename($lib_example_plugin) : "");
     $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
@@ -1991,7 +1992,8 @@ sub environment_setup {
   my $lib_fed_plugin=
     mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename),
                    "$basedir/storage/federated/.libs/".$fedplug_filename,
-                   "$basedir/lib/mysql/plugin/".$fedplug_filename);
+                   "$basedir/lib/mysql/plugin/".$fedplug_filename,
+                   "$basedir/lib64/mysql/plugin/".$fedplug_filename);
 
   $ENV{'FEDERATED_PLUGIN'}= $fedplug_filename;
   $ENV{'FEDERATED_PLUGIN_DIR'}=
diff -up mysql-5.1.61/mysql-test/mysql-test-run.plugindir mysql-5.1.61/mysql-test/mysql-test-run
--- mysql-5.1.61/mysql-test/mysql-test-run.plugindir    2012-04-10 18:12:44.660950752 +0200
+++ mysql-5.1.61/mysql-test/mysql-test-run      2012-04-10 18:13:09.643970496 +0200
@@ -1969,7 +1969,8 @@ sub environment_setup {
     my $lib_example_plugin=
       mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
                      "$basedir/storage/example/.libs/".$plugin_filename,
-                      "$basedir/lib/mysql/plugin/".$plugin_filename);
+                      "$basedir/lib/mysql/plugin/".$plugin_filename,
+                      "$basedir/lib64/mysql/plugin/".$plugin_filename);
     $ENV{'EXAMPLE_PLUGIN'}=
       ($lib_example_plugin ? basename($lib_example_plugin) : "");
     $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
@@ -1991,7 +1992,8 @@ sub environment_setup {
   my $lib_fed_plugin=
     mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename),
                    "$basedir/storage/federated/.libs/".$fedplug_filename,
-                   "$basedir/lib/mysql/plugin/".$fedplug_filename);
+                   "$basedir/lib/mysql/plugin/".$fedplug_filename,
+                   "$basedir/lib64/mysql/plugin/".$fedplug_filename);
 
   $ENV{'FEDERATED_PLUGIN'}= $fedplug_filename;
   $ENV{'FEDERATED_PLUGIN_DIR'}=
[10 Apr 2012 17:30] [ name withheld ]
Just to be clear: this test does pass when run in a build tree.  The problem is that it fails with the installed RPMs (using the RHEL or Fedora mysql-test RPM) because mysql-test-run doesn't know that LIBDIR isn't /usr/lib in a 64-bit build.

I'm of the opinion that it'd be a good thing if mysql-test-run were explicitly configured with knowledge of the selected installation LIBDIR, as it is for BINDIR.
[10 Apr 2012 17:55] Sveta Smirnova
Thank you for the report.

Which package do you use? If you compiled yourself, please, provide compile options.
[10 Apr 2012 18:24] [ name withheld ]
The case of interest here is the RHEL and Fedora RPMs.  The configure options in 64-bit cases look like

./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-readline --with-ssl=/usr --without-debug --enable-shared --with-embedded-server --localstatedir=/var/lib/mysql --with-unix-socket-path=/var/lib/mysql/mysql.sock --with-mysqld-user=mysql --with-extra-charsets=all --with-big-tables --with-pic --with-plugin-innobase --with-plugin-innodb_plugin --with-plugin-partition --enable-local-infile --enable-largefile --enable-thread-safe-client --disable-dependency-tracking

Note the --libdir setting in particular.  We've seen repeated problems with regression tests looking for files under /usr/lib/ when they should be looking under /usr/lib64/.
[10 Apr 2012 19:01] Sveta Smirnova
Thank you for the feedback.

Verified as described. Option which matters is  --libdir which should be pointed to non-standard location.
[15 Jun 2012 3:19] Paul DuBois
Changes to test suite. No changelog entry needed.