diff options
author | unknown <georg@lmy002.wdf.sap.corp> | 2006-09-22 14:42:43 +0200 |
---|---|---|
committer | unknown <georg@lmy002.wdf.sap.corp> | 2006-09-22 14:42:43 +0200 |
commit | 0c5d362750de372916ba65320e30316940e3733b (patch) | |
tree | e6aa73996f37344a3342e05e97615ac41339ba56 /sql | |
parent | fcd21bd4ad5b1837ab292880bf113894488b45bb (diff) | |
download | mariadb-git-0c5d362750de372916ba65320e30316940e3733b.tar.gz |
Fix for bug #19121: Windows incompatible udf_example
mysql-test/mysql-test-run.pl:
fixed path for udf_example.so when running testsuite on Windows
sql/CMakeLists.txt:
Added missing udf_example
sql/Makefile.am:
Added udf_example files for make dist
sql/udf_example.c:
fix for Windows: Windows doesn't have socket.h and friends
Added replacements for strmov,bzero and memcpy_fixed when compiling standalone.
sql/udf_example.def:
BitKeeper file /home/georg/work/mysql/prod/mysql-5.0-win/sql/udf_example.def
Diffstat (limited to 'sql')
-rwxr-xr-x | sql/CMakeLists.txt | 5 | ||||
-rw-r--r-- | sql/Makefile.am | 3 | ||||
-rw-r--r-- | sql/udf_example.c | 11 | ||||
-rw-r--r-- | sql/udf_example.def | 24 |
4 files changed, 41 insertions, 2 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b01871872ce..9b2fae847d6 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -110,5 +110,8 @@ ADD_CUSTOM_COMMAND( COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h DEPENDS ${GEN_LEX_HASH_EXE} ) - ADD_DEPENDENCIES(mysqld gen_lex_hash) + +ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def) +ADD_DEPENDENCIES(udf_example strings) +TARGET_LINK_LIBRARIES(udf_example wsock32) diff --git a/sql/Makefile.am b/sql/Makefile.am index 98c8fe784eb..e837e10472c 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -117,7 +117,8 @@ DEFS = -DMYSQL_SERVER \ BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h EXTRA_DIST = $(BUILT_SOURCES) nt_servc.cc nt_servc.h \ - message.mc examples/CMakeLists.txt CMakeLists.txt + message.mc examples/CMakeLists.txt CMakeLists.txt \ + udf_example.c udf_example.def DISTCLEANFILES = lex_hash.h sql_yacc.output AM_YFLAGS = -d --debug --verbose diff --git a/sql/udf_example.c b/sql/udf_example.c index a80fce81278..2fa7474eb16 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -127,7 +127,14 @@ typedef long long longlong; #else #include <my_global.h> #include <my_sys.h> +#if defined(MYSQL_SERVER) #include <m_string.h> /* To get strmov() */ +#else +/* when compiled as standalone */ +#define strmov(a,b) strcpy(a,b) +#define bzero(a,b) memset(a,0,b) +#define memcpy_fixed(a,b,c) memcpy(a,b,c) +#endif #endif #include <mysql.h> #include <ctype.h> @@ -674,10 +681,14 @@ longlong sequence(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args, ** ****************************************************************************/ +#ifdef __WIN__ +#include <winsock.h> +#else #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> +#endif my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message); void lookup_deinit(UDF_INIT *initid); diff --git a/sql/udf_example.def b/sql/udf_example.def new file mode 100644 index 00000000000..d3081ca7768 --- /dev/null +++ b/sql/udf_example.def @@ -0,0 +1,24 @@ +LIBRARY udf_example +DESCRIPTION 'MySQL Sample for UDF' +VERSION 1.0 +EXPORTS + lookup + lookup_init + reverse_lookup + reverse_lookup_init + metaphon_init + metaphon_deinit + metaphon + myfunc_double_init + myfunc_double + myfunc_int_init + myfunc_int + sequence_init + sequence_deinit + sequence + avgcost_init + avgcost_deinit + avgcost_reset + avgcost_add + avgcost_clear + avgcost |