Commit 3b03f5d9 authored by Sergei Golubchik's avatar Sergei Golubchik

fixes for windows builds

parent c7d17358
...@@ -38,6 +38,7 @@ ADD_DEFINITIONS(-DMYSQL_DATADIR="c:/Program Files/MySQL/MySQL Server ${MYSQL_BAS ...@@ -38,6 +38,7 @@ ADD_DEFINITIONS(-DMYSQL_DATADIR="c:/Program Files/MySQL/MySQL Server ${MYSQL_BAS
ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/") ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
ADD_DEFINITIONS(-DPACKAGE=mysql) ADD_DEFINITIONS(-DPACKAGE=mysql)
ADD_DEFINITIONS(-DSHAREDIR="share") ADD_DEFINITIONS(-DSHAREDIR="share")
ADD_DEFINITIONS(-DPLUGINDIR="lib/plugin")
# Set debug options # Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
......
...@@ -75,8 +75,7 @@ bufferevent_add(struct event *ev, int timeout) ...@@ -75,8 +75,7 @@ bufferevent_add(struct event *ev, int timeout)
*/ */
void void
bufferevent_read_pressure_cb(struct evbuffer *buf, bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
size_t old __attribute__((unused)), size_t now,
void *arg) { void *arg) {
struct bufferevent *bufev = arg; struct bufferevent *bufev = arg;
/* /*
......
...@@ -394,8 +394,7 @@ event_base_get_method(struct event_base *base) ...@@ -394,8 +394,7 @@ event_base_get_method(struct event_base *base)
} }
static void static void
event_loopexit_cb(int fd __attribute__((unused)), event_loopexit_cb(int fd, short what, void *arg)
short what __attribute__((unused)), void *arg)
{ {
struct event_base *base = arg; struct event_base *base = arg;
base->event_gotterm = 1; base->event_gotterm = 1;
......
...@@ -69,7 +69,7 @@ static void evsignal_handler(int sig); ...@@ -69,7 +69,7 @@ static void evsignal_handler(int sig);
/* Callback for when the signal handler write a byte to our signaling socket */ /* Callback for when the signal handler write a byte to our signaling socket */
static void static void
evsignal_cb(int fd, short what __attribute((unused)), void *arg __attribute((unused))) evsignal_cb(int fd, short what, void *arg)
{ {
static char signals[100]; static char signals[100];
#ifdef WIN32 #ifdef WIN32
......
...@@ -311,7 +311,9 @@ struct charset_info_st ...@@ -311,7 +311,9 @@ struct charset_info_st
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U) #define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin; extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
extern struct charset_info_st my_charset_bin; extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
extern struct charset_info_st my_charset_big5_chinese_ci; extern struct charset_info_st my_charset_big5_chinese_ci;
extern struct charset_info_st my_charset_big5_bin; extern struct charset_info_st my_charset_big5_bin;
extern struct charset_info_st my_charset_cp932_japanese_ci; extern struct charset_info_st my_charset_cp932_japanese_ci;
...@@ -324,7 +326,6 @@ extern struct charset_info_st my_charset_gb2312_chinese_ci; ...@@ -324,7 +326,6 @@ extern struct charset_info_st my_charset_gb2312_chinese_ci;
extern struct charset_info_st my_charset_gb2312_bin; extern struct charset_info_st my_charset_gb2312_bin;
extern struct charset_info_st my_charset_gbk_chinese_ci; extern struct charset_info_st my_charset_gbk_chinese_ci;
extern struct charset_info_st my_charset_gbk_bin; extern struct charset_info_st my_charset_gbk_bin;
extern struct charset_info_st my_charset_latin1;
extern struct charset_info_st my_charset_latin1_german2_ci; extern struct charset_info_st my_charset_latin1_german2_ci;
extern struct charset_info_st my_charset_latin1_bin; extern struct charset_info_st my_charset_latin1_bin;
extern struct charset_info_st my_charset_latin2_czech_ci; extern struct charset_info_st my_charset_latin2_czech_ci;
...@@ -341,7 +342,6 @@ extern struct charset_info_st my_charset_utf8_general_ci; ...@@ -341,7 +342,6 @@ extern struct charset_info_st my_charset_utf8_general_ci;
extern struct charset_info_st my_charset_utf8_unicode_ci; extern struct charset_info_st my_charset_utf8_unicode_ci;
extern struct charset_info_st my_charset_utf8_bin; extern struct charset_info_st my_charset_utf8_bin;
extern struct charset_info_st my_charset_cp1250_czech_ci; extern struct charset_info_st my_charset_cp1250_czech_ci;
extern struct charset_info_st my_charset_filename;
/* declarations for simple charsets */ /* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
......
...@@ -1522,6 +1522,9 @@ do { doubleget_union _tmp; \ ...@@ -1522,6 +1522,9 @@ do { doubleget_union _tmp; \
#elif defined(HAVE_DLFCN_H) #elif defined(HAVE_DLFCN_H)
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#ifndef HAVE_DLERROR
#define dlerror() ""
#endif
#endif #endif
/* FreeBSD 2.2.2 does not define RTLD_NOW) */ /* FreeBSD 2.2.2 does not define RTLD_NOW) */
...@@ -1529,7 +1532,7 @@ do { doubleget_union _tmp; \ ...@@ -1529,7 +1532,7 @@ do { doubleget_union _tmp; \
#define RTLD_NOW 1 #define RTLD_NOW 1
#endif #endif
#ifndef HAVE_DLERROR #ifndef HAVE_DLOPEN
#define dlerror() "No support for dynamic loading (static build?)" #define dlerror() "No support for dynamic loading (static build?)"
#define dlopen(A,B) 0 #define dlopen(A,B) 0
#define dlsym(A,B) 0 #define dlsym(A,B) 0
......
...@@ -27,7 +27,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc ...@@ -27,7 +27,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc
user_management_commands.cc user_management_commands.cc
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
../../libmysql/errmsg.c) ../../libmysql/errmsg.c ../../sql-common/client_plugin.c)
ADD_DEPENDENCIES(mysqlmanager GenError) ADD_DEPENDENCIES(mysqlmanager GenError)
TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32) TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32)
...@@ -28,7 +28,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc ...@@ -28,7 +28,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc
user_management_commands.cc ../../mysys/my_rnd.c user_management_commands.cc ../../mysys/my_rnd.c
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
../../libmysql/errmsg.c) ../../libmysql/errmsg.c ../../sql-common/client_plugin.c)
ADD_DEPENDENCIES(mysqlmanager GenError) ADD_DEPENDENCIES(mysqlmanager GenError)
TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl zlib wsock32) TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl zlib wsock32)
......
...@@ -2345,7 +2345,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info) ...@@ -2345,7 +2345,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
case VIO_TYPE_SSL: case VIO_TYPE_SSL:
{ {
struct sockaddr addr; struct sockaddr addr;
socklen_t addrlen= sizeof(addr); SOCKET_SIZE_TYPE addrlen= sizeof(addr);
if (getsockname(vio->sd, &addr, &addrlen)) if (getsockname(vio->sd, &addr, &addrlen))
return; return;
info->protocol= addr.sa_family == AF_UNIX ? info->protocol= addr.sa_family == AF_UNIX ?
...@@ -2360,7 +2360,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info) ...@@ -2360,7 +2360,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
return; return;
case VIO_TYPE_SHARED_MEMORY: case VIO_TYPE_SHARED_MEMORY:
info->protocol= MYSQL_VIO_MEMORY; info->protocol= MYSQL_VIO_MEMORY;
info->handle= vio->handle_client_file_map; /* or what ? */ info->handle= vio->handle_file_map; /* or what ? */
return; return;
#endif #endif
default: DBUG_ASSERT(0); default: DBUG_ASSERT(0);
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#define mysql_master_send_query(A, B, C) 1 #define mysql_master_send_query(A, B, C) 1
#define mysql_slave_send_query(A, B, C) 1 #define mysql_slave_send_query(A, B, C) 1
#define mysql_rpl_probe(mysql) 0 #define mysql_rpl_probe(mysql) 0
#undef HAVE_SMEM
#undef _CUSTOMCONFIG_ #undef _CUSTOMCONFIG_
#define mysql_server_init(a,b,c) mysql_client_plugin_init() #define mysql_server_init(a,b,c) mysql_client_plugin_init()
......
...@@ -1716,8 +1716,7 @@ beg: ...@@ -1716,8 +1716,7 @@ beg:
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
{ {
size_t d, t; uint64 d, t, i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
d= i64 / 1000000; d= i64 / 1000000;
t= i64 % 1000000; t= i64 % 1000000;
my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d", my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d",
......
...@@ -6645,8 +6645,6 @@ Can't be set to 1 if --log-slave-updates is used.", ...@@ -6645,8 +6645,6 @@ Can't be set to 1 if --log-slave-updates is used.",
{"shared-memory", OPT_ENABLE_SHARED_MEMORY, {"shared-memory", OPT_ENABLE_SHARED_MEMORY,
"Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory, "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#ifdef HAVE_SMEM
{"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
......
...@@ -924,7 +924,7 @@ void THD::update_stats(void) ...@@ -924,7 +924,7 @@ void THD::update_stats(void)
/* A SQL query. */ /* A SQL query. */
if (lex->sql_command == SQLCOM_SELECT) if (lex->sql_command == SQLCOM_SELECT)
select_commands++; select_commands++;
else if (! sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) else if (! (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND))
{ {
/* Ignore 'SHOW ' commands */ /* Ignore 'SHOW ' commands */
} }
......
...@@ -2529,8 +2529,8 @@ int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table) ...@@ -2529,8 +2529,8 @@ int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
table->field[j++]->store(user_stats->user, user_stats->user_name_length, table->field[j++]->store(user_stats->user, user_stats->user_name_length,
system_charset_info); system_charset_info);
table->field[j++]->store((longlong)user_stats->total_connections,TRUE); table->field[j++]->store((longlong)user_stats->total_connections,TRUE);
table->field[j++]->store((longlong)user_stats->concurrent_connections); table->field[j++]->store((longlong)user_stats->concurrent_connections, TRUE);
table->field[j++]->store((longlong)user_stats->connected_time); table->field[j++]->store((longlong)user_stats->connected_time, TRUE);
table->field[j++]->store((double)user_stats->busy_time); table->field[j++]->store((double)user_stats->busy_time);
table->field[j++]->store((double)user_stats->cpu_time); table->field[j++]->store((double)user_stats->cpu_time);
table->field[j++]->store((longlong)user_stats->bytes_received, TRUE); table->field[j++]->store((longlong)user_stats->bytes_received, TRUE);
......
...@@ -1274,10 +1274,11 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file, ...@@ -1274,10 +1274,11 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file,
for (file= from_file; file <= to_file; file++) for (file= from_file; file <= to_file; file++)
{ {
LOGHANDLER_FILE_INFO info; LOGHANDLER_FILE_INFO info;
LINT_INIT(info.max_lsn);
File fd= open_logfile_by_number_no_cache(file); File fd= open_logfile_by_number_no_cache(file);
LINT_INIT_STRUCT(info); LINT_INIT_STRUCT(info);
LINT_INIT(info.max_lsn);
if ((fd < 0) || if ((fd < 0) ||
((translog_read_file_header(&info, fd) || ((translog_read_file_header(&info, fd) ||
(cmp_translog_addr(lsn, info.max_lsn) > 0 && (cmp_translog_addr(lsn, info.max_lsn) > 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment