mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
Windows 64bit fixes
Fixed udf_example, so tests now can also run udf on win. sql/udf_example.def: BitKeeper file /home/georg/work/mysql/prod/mysql-5.1-win/sql/udf_example.def include/config-win.h: removed USE_32_BIT_TIME include/my_time.h: Fixed size of my_time for Win64 (should be 64bit) mysql-test/mysql-test-run.pl: Added windows paths for udf_example sql/CMakeLists.txt: Added udf_example.dll sql/udf_example.c: Windows doesn't know about socket.h and friends. Use winsock.h instead
This commit is contained in:
@@ -25,7 +25,6 @@ functions */
|
|||||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||||
/* Avoid endless warnings about sprintf() etc. being unsafe. */
|
/* Avoid endless warnings about sprintf() etc. being unsafe. */
|
||||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||||
#define _USE_32BIT_TIME_T 1 /* force time_t to be 32 bit */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/locking.h>
|
#include <sys/locking.h>
|
||||||
|
@@ -33,7 +33,12 @@ extern uchar days_in_month[];
|
|||||||
Portable time_t replacement.
|
Portable time_t replacement.
|
||||||
Should be signed and hold seconds for 1902-2038 range.
|
Should be signed and hold seconds for 1902-2038 range.
|
||||||
*/
|
*/
|
||||||
|
#if defined(_WIN64) || defined(WIN64)
|
||||||
|
/* on Win64 long is still 4 bytes (not 8!) */
|
||||||
|
typedef LONG64 my_time_t;
|
||||||
|
#else
|
||||||
typedef long my_time_t;
|
typedef long my_time_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MY_TIME_T_MAX LONG_MAX
|
#define MY_TIME_T_MAX LONG_MAX
|
||||||
#define MY_TIME_T_MIN LONG_MIN
|
#define MY_TIME_T_MIN LONG_MIN
|
||||||
|
@@ -1240,7 +1240,9 @@ sub executable_setup () {
|
|||||||
$exe_ndbd= "$glob_basedir/storage/ndb/src/kernel/ndbd";
|
$exe_ndbd= "$glob_basedir/storage/ndb/src/kernel/ndbd";
|
||||||
$exe_ndb_mgmd= "$glob_basedir/storage/ndb/src/mgmsrv/ndb_mgmd";
|
$exe_ndb_mgmd= "$glob_basedir/storage/ndb/src/mgmsrv/ndb_mgmd";
|
||||||
$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
|
||||||
{
|
{
|
||||||
|
@@ -117,3 +117,7 @@ ADD_CUSTOM_COMMAND(
|
|||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
|
@@ -674,10 +674,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
|
Reference in New Issue
Block a user