diff options
author | mhansson@dl145s.mysql.com <> | 2007-05-31 14:22:21 +0200 |
---|---|---|
committer | mhansson@dl145s.mysql.com <> | 2007-05-31 14:22:21 +0200 |
commit | 3ee16518618ee73cc0d4e0b2e47124dc83adfe5d (patch) | |
tree | 3b88e915652c80e942d1fbd5789f1791e7e4df5a /sql/udf_example.c | |
parent | bb089cea3852546e37d6a241b35f9223759b88c1 (diff) | |
download | mariadb-git-3ee16518618ee73cc0d4e0b2e47124dc83adfe5d.tar.gz |
bug#27741: udf test fails on AIX < 5.3
problem #1: udf_example.so does not get built on AIX
solution#1: build it yourself using
cd sql; gcc -g -I ../include/ -I /usr/include/ -lpthread \
-shared -o udf_example.so udf_example.c; mv udf_example.so \
.libs/
problem#2 (the bug): udf_example fails because it does not
recognize the variable LD_LIBRARY_PATH when doing dl_open(),
it looks at LIBPATH
solution#2: add the library path to LIBPATH
problem#3: udf_example returns the wrong result length since
it relies on strmov to return a pointer to the end of the
string that it copies. On AIX builds, where m_string.h is not
included (m_string defines a macro expanding strmov to stpcpy),
there is a macro expanding strmov to strcpy, which returns a
pointer to the first character.
solution#3: define strmov as stpcpy.
problem#4: #2 applies on hp-ux as well, but this platform
looks at SHLIB_PATH
solution#4: added the library path to SHLIB_PATH
Diffstat (limited to 'sql/udf_example.c')
-rw-r--r-- | sql/udf_example.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/udf_example.c b/sql/udf_example.c index 2bb4fe92d2f..0f28c2a14b0 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -130,7 +130,8 @@ typedef long long longlong; #include <m_string.h> /* To get strmov() */ #else /* when compiled as standalone */ -#define strmov(a,b) strcpy(a,b) +#include <string.h> +#define strmov(a,b) stpcpy(a,b) #define bzero(a,b) memset(a,0,b) #define memcpy_fixed(a,b,c) memcpy(a,b,c) #endif |