mirror of
https://github.com/MariaDB/server.git
synced 2025-06-04 18:03:14 +03:00
Fix for bug #19121: Windows incompatible udf_example
This commit is contained in:
parent
ca00ba4991
commit
67a701003c
@ -2,3 +2,4 @@
|
|||||||
44ec850ac2k4y2Omgr92GiWPBAVKGQ
|
44ec850ac2k4y2Omgr92GiWPBAVKGQ
|
||||||
44edb86b1iE5knJ97MbliK_3lCiAXA
|
44edb86b1iE5knJ97MbliK_3lCiAXA
|
||||||
44f33f3aj5KW5qweQeekY1LU0E9ZCg
|
44f33f3aj5KW5qweQeekY1LU0E9ZCg
|
||||||
|
4513d8e4Af4dQWuk13sArwofRgFDQw
|
||||||
|
@ -1110,7 +1110,9 @@ sub executable_setup () {
|
|||||||
$path_ndb_tools_dir= mtr_path_exists("$glob_basedir/ndb/tools");
|
$path_ndb_tools_dir= mtr_path_exists("$glob_basedir/ndb/tools");
|
||||||
$exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm";
|
$exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm";
|
||||||
$lib_udf_example=
|
$lib_udf_example=
|
||||||
mtr_file_exists("$glob_basedir/sql/.libs/udf_example.so");
|
mtr_file_exists("$glob_basedir/sql/.libs/udf_example.so",
|
||||||
|
"$glob_basedir/sql/release/udf_example.dll",
|
||||||
|
"$glob_basedir/sql/debug/udf_example.dll");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -110,5 +110,8 @@ ADD_CUSTOM_COMMAND(
|
|||||||
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
|
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
|
||||||
DEPENDS ${GEN_LEX_HASH_EXE}
|
DEPENDS ${GEN_LEX_HASH_EXE}
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_DEPENDENCIES(mysqld gen_lex_hash)
|
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)
|
||||||
|
@ -117,7 +117,8 @@ DEFS = -DMYSQL_SERVER \
|
|||||||
|
|
||||||
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
|
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
|
||||||
EXTRA_DIST = $(BUILT_SOURCES) nt_servc.cc nt_servc.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
|
DISTCLEANFILES = lex_hash.h sql_yacc.output
|
||||||
|
|
||||||
AM_YFLAGS = -d --debug --verbose
|
AM_YFLAGS = -d --debug --verbose
|
||||||
|
@ -127,7 +127,14 @@ typedef long long longlong;
|
|||||||
#else
|
#else
|
||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
|
#if defined(MYSQL_SERVER)
|
||||||
#include <m_string.h> /* To get strmov() */
|
#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
|
#endif
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <ctype.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 <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
|
my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
|
||||||
void lookup_deinit(UDF_INIT *initid);
|
void lookup_deinit(UDF_INIT *initid);
|
||||||
|
24
sql/udf_example.def
Normal file
24
sql/udf_example.def
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user