Bug #4336 ldconfig no good for udf's unless udf filename starts with "lib"
Submitted: 29 Jun 2004 23:26 Modified: 8 Aug 2004 19:22
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:all OS:unix with ldconfig
Assigned to: Paul DuBois CPU Architecture:Any

[29 Jun 2004 23:26] Matthew Lord
ldconfig appears to ignore libraries/shared objects that do not start with the word "lib".   This is not 
within our control but it should be mentioned in our documentation here:


How to repeat:
gcc -shared -I/usr/local/mysql/include/mysql -o testcode.so -c testcode.cc

# testcode.cc is attached, just a simple udf

place testcode.so in /lib/ /usr/lib or use LD_LIBRARY_PATH and

create function plustwo returns int soname "testcode.so"; 

works just fine.  Move testcode.so to say, /usr/local/lib, run ldconfig
and mysqld will not find it.  You can see with ldconfig -p | grep testcode that it
is not there.  If you rename the so to /usr/local/lib/libtestcode.so, run ldconfig
again and now it's there and mysqld can find it.

Suggested fix:
mention the fact that ldconfig will ignore the udf unless it starts with "lib" in the UDF_compiling.html
[30 Jun 2004 21:10] Hartmut Holzgraefe
Is this a general unix problem or does it only
happen on specific platforms? 
I can't remember having any problem like this
on linux while doing UDF stuff ...
[30 Jun 2004 21:21] Matthew Lord
Hi Hartmut,

This is ldconfig behavior that we need to document.  I never noticed it when doing UDF stuff 
before either because I wasn't relying on ldconfig and it's cache, I was always using /lib/ /usr/lib 
or LD_LIBRARY_PATH.  ldconfig does not add anything to it's cache unless it starts with lib.  I've 
provided a test case.

[8 Aug 2004 19:22] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant