Bug #40942 Unable to install federated plugin
Submitted: 21 Nov 2008 21:05 Modified: 29 Sep 2011 18:36
Reporter: BJ Dierkes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.29-rc, 5.4 OS:Linux (Redhat Enterprise Linux 4 ES and 5 Server)
Assigned to: Bjørn Munch CPU Architecture:Any
Tags: plugins federated
Triage: Triaged: D3 (Medium)

[21 Nov 2008 21:05] BJ Dierkes
Description:
Unable to install federated plugin.

How to repeat:
configure && make && make install

mysql> install plugin federated soname 'ha_federated.so';
ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/ha_federated.so' (errno: 22 undefined symbol: dynstr_append_mem)

The following is my complete configure line.

  ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu \
        --target=i386-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/lib \
        --libexecdir=/usr/libexec \
        --localstatedir=/var \
        --sharedstatedir=/usr/com \
        --mandir=/usr/share/man \
        --infodir=/usr/share/info \
        --with-pic \
        --with-readline \
        --with-ssl \
        --without-debug \
        --enable-shared \
        --with-bench \
        --localstatedir=/var/lib/mysql \
        --with-unix-socket-path=/var/lib/mysql/mysql.sock \
        --with-mysqld-user="mysql" \
        --with-extra-charsets=all \
        --with-innodb \
        --with-berkeley-db \
        --enable-local-infile \
        --enable-largefile \
        --enable-thread-safe-client \
        --disable-dependency-tracking \
        --with-plugin-partition \
        --with-plugin-csv \
        --with-plugin-ndbcluster \
         \
        --with-named-thread-libs="-lpthread"

And ldd looks fine:

[root@esx02-bjd-el5-i386 ~]# ldd -v /usr/lib/mysql/plugin/ha_federated.so
        linux-gate.so.1 =>  (0x00ea0000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00a6f000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x008e0000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00d25000)
        libm.so.6 => /lib/libm.so.6 (0x004cc000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00110000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x008b8000)
        libc.so.6 => /lib/libc.so.6 (0x00b34000)
        /lib/ld-linux.so.2 (0x0065f000)

        Version information:
        /usr/lib/mysql/plugin/ha_federated.so:
                libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libpthread.so.0:
                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libcrypt.so.1:
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libnsl.so.1:
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libm.so.6:
                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /usr/lib/libstdc++.so.6:
                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                libgcc_s.so.1 (GCC_4.2.0) => /lib/libgcc_s.so.1
                libgcc_s.so.1 (GLIBC_2.0) => /lib/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
                libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
        /lib/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libc.so.6:
                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
[22 Nov 2008 8:05] Sveta Smirnova
Thank you for the report.

Verified as described.
[4 Mar 2009 22:43] BJ Dierkes
Verified to still be failing on MySQL 5.1.32 (RHEL 5).
[15 Jun 2009 6:38] Sveta Smirnova
Bug #45488 was marked as duplicate of this one.
[21 Apr 2010 9:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/106202

3143 Horst.Hunger	2010-04-21
      Patch for bug#47759 after review including a test. The result file is empty as the test failed due to bug#40942. The plugin test needs to be completed after this bug will be fixed.
[21 May 2010 22:36] BJ Dierkes
Still broken as of 5.1.47....  It seems to me that the committed patch was for 5.5, and not for 5.1.  Are there any plans to port this fix for 5.1?
[22 May 2010 7:47] Olav Sandstå
The patch attached to this bug was for Bug#47759 (a problem related to building plugins containing DTrace probes). It did not provide a fix for this bug. It was automagically attaced to this bug report due to the commit message having a reference to this bug number. Setting status back to verified.
[4 Jun 2010 19:15] [ name withheld ]
The problem seems to be that mysys/string.c is no longer used anywhere in the core mysqld code.  Since mysqld is linked against the static library libmysys.a, only actually-used mysys/*.o modules get pulled into the core executable.  Then ha_federated.so loses, because it still needs the string.c routines.

As a workaround I'm forcibly linking string.o into ha_federated.so, but I wonder whether it wouldn't be better as a long-term fix to link all of the mysys/*.o modules into the server explicitly (not using the .a library).  This would ensure a stable set of routines are available to plugins.
[29 Sep 2011 18:36] Paul Dubois
Noted in 5.1.60, 5.5.17, 5.6.4 changelogs.

A linking problem prevented the FEDERATED storage engine plugin from
loading.
[7 Dec 2011 0:10] Floren Munteanu
This issue is still present in 5.1.60, do we have a viable patch?
[15 Dec 2011 8:58] Bjørn Munch
To the last comment: in what way do you see this failing? Please note that the federated *plugin* is not included in our binary releases, you can only get it by building from source yourself. The fix for this issue was included in 5.1.60.

If you do have the plugin (ha_federated.so or ha_federated.dll) and still see the problem, please provide some details (platform, symptom etc).