Commit 2083b7dd authored by Sergey Petrunya's avatar Sergey Petrunya

Make MariaDB work on windows:

- fix xtradb compile failures on windows (why do we have to do it again?)
parent 75681669
...@@ -663,7 +663,8 @@ uint master_port= MYSQL_PORT, master_connect_retry = 60; ...@@ -663,7 +663,8 @@ uint master_port= MYSQL_PORT, master_connect_retry = 60;
uint report_port= MYSQL_PORT; uint report_port= MYSQL_PORT;
ulong master_retry_count=0; ulong master_retry_count=0;
char *master_user, *master_password, *master_host, *master_info_file; char *master_user, *master_password, *master_host, *master_info_file;
char *relay_log_info_file, *report_user, *report_password, *report_host; char *relay_log_info_file;
char *report_user, *report_password, *report_host;
char *opt_relay_logname = 0, *opt_relaylog_index_name=0; char *opt_relay_logname = 0, *opt_relaylog_index_name=0;
my_bool master_ssl; my_bool master_ssl;
char *master_ssl_key, *master_ssl_cert; char *master_ssl_key, *master_ssl_cert;
......
...@@ -101,7 +101,8 @@ extern MY_BITMAP slave_error_mask; ...@@ -101,7 +101,8 @@ extern MY_BITMAP slave_error_mask;
extern char slave_skip_error_names[]; extern char slave_skip_error_names[];
extern bool use_slave_mask; extern bool use_slave_mask;
extern char *slave_load_tmpdir; extern char *slave_load_tmpdir;
extern char *master_info_file, *relay_log_info_file; extern char *master_info_file;
extern MYSQL_PLUGIN_IMPORT char *relay_log_info_file;
extern char *opt_relay_logname, *opt_relaylog_index_name; extern char *opt_relay_logname, *opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave; extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates; extern my_bool opt_log_slave_updates;
...@@ -205,7 +206,7 @@ extern int disconnect_slave_event_count, abort_slave_event_count ; ...@@ -205,7 +206,7 @@ extern int disconnect_slave_event_count, abort_slave_event_count ;
/* the master variables are defaults read from my.cnf or command line */ /* the master variables are defaults read from my.cnf or command line */
extern uint master_port, master_connect_retry, report_port; extern uint master_port, master_connect_retry, report_port;
extern char * master_user, *master_password, *master_host; extern char * master_user, *master_password, *master_host;
extern char *master_info_file, *relay_log_info_file, *report_user; extern char *master_info_file, *report_user;
extern char *report_host, *report_password; extern char *report_host, *report_password;
extern my_bool master_ssl; extern my_bool master_ssl;
......
...@@ -63,5 +63,5 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ...@@ -63,5 +63,5 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
usr/usr0sess.c usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c) ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c)
MYSQL_STORAGE_ENGINE(INNOBASE) ## psergey: MYSQL_STORAGE_ENGINE(INNOBASE)
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-D_WIN32 -D_LIB) INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
ADD_DEFINITIONS(-D_WIN32 -D_LIB -DMYSQL_SERVER)
# Bug 19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C) # Bug 19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C)
# Removing Win64 compiler optimizations for all innodb/mem/* files. # Removing Win64 compiler optimizations for all innodb/mem/* files.
...@@ -66,32 +67,5 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ...@@ -66,32 +67,5 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
usr/usr0sess.c usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c) ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c)
IF(NOT SOURCE_SUBLIBS) MYSQL_STORAGE_ENGINE(INNOBASE)
ADD_LIBRARY(innobase ${INNOBASE_SOURCES})
ADD_DEPENDENCIES(innobase GenError)
SET_TARGET_PROPERTIES(innobase PROPERTIES COMPILE_FLAGS "-DMYSQL_SERVER")
IF(INNODB_DYNAMIC_PLUGIN)
# The dynamic plugin requires CMake 2.6.0 or later. Otherwise, the /DELAYLOAD property
# will not be set
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
ADD_LIBRARY(ha_innodb SHARED ${INNOBASE_SOURCES} ha_innodb.def handler/win_delay_loader.cc)
ADD_DEPENDENCIES(ha_innodb GenError mysqld)
# If build type is not specified as Release, default to Debug
# This is a workaround to a problem in CMake 2.6, which does not
# set the path of mysqld.lib correctly
IF(CMAKE_BUILD_TYPE MATCHES Release)
SET(CMAKE_BUILD_TYPE "Release")
ELSE(CMAKE_BUILD_TYPE MATCHES Release)
SET(CMAKE_BUILD_TYPE "Debug")
ENDIF(CMAKE_BUILD_TYPE MATCHES Release)
TARGET_LINK_LIBRARIES(ha_innodb strings zlib)
TARGET_LINK_LIBRARIES(ha_innodb ${CMAKE_SOURCE_DIR}/sql/${CMAKE_BUILD_TYPE}/mysqld.lib)
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES OUTPUT_NAME ha_innodb)
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/MAP /MAPINFO:EXPORTS")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/ENTRY:\"_DllMainCRTStartup@12\"")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES COMPILE_FLAGS "-DMYSQL_DYNAMIC_PLUGIN")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/DELAYLOAD:mysqld.exe")
ENDIF(INNODB_DYNAMIC_PLUGIN)
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -3267,6 +3267,7 @@ btr_estimate_number_of_different_key_vals( ...@@ -3267,6 +3267,7 @@ btr_estimate_number_of_different_key_vals(
} }
while (rec != supremum) { while (rec != supremum) {
rec_t* next_rec;
/* count recs */ /* count recs */
if (stats_method == SRV_STATS_METHOD_IGNORE_NULLS) { if (stats_method == SRV_STATS_METHOD_IGNORE_NULLS) {
n_recs++; n_recs++;
...@@ -3281,7 +3282,7 @@ btr_estimate_number_of_different_key_vals( ...@@ -3281,7 +3282,7 @@ btr_estimate_number_of_different_key_vals(
} }
} }
rec_t* next_rec = page_rec_get_next(rec); next_rec = page_rec_get_next(rec);
if (next_rec == supremum) { if (next_rec == supremum) {
break; break;
} }
......
...@@ -461,11 +461,11 @@ buf_buddy_relocate( ...@@ -461,11 +461,11 @@ buf_buddy_relocate(
actually is a properly initialized buf_page_t object. */ actually is a properly initialized buf_page_t object. */
if (size >= PAGE_ZIP_MIN_SIZE) { if (size >= PAGE_ZIP_MIN_SIZE) {
mutex_t* mutex;
if (!have_page_hash_mutex) if (!have_page_hash_mutex)
mutex_exit(&zip_free_mutex); mutex_exit(&zip_free_mutex);
/* This is a compressed page. */ /* This is a compressed page. */
mutex_t* mutex;
if (!have_page_hash_mutex) { if (!have_page_hash_mutex) {
mutex_enter(&LRU_list_mutex); mutex_enter(&LRU_list_mutex);
......
...@@ -1216,6 +1216,7 @@ buf_flush_LRU_recommendation(void) ...@@ -1216,6 +1216,7 @@ buf_flush_LRU_recommendation(void)
ulint n_replaceable; ulint n_replaceable;
ulint distance = 0; ulint distance = 0;
ibool have_LRU_mutex = FALSE; ibool have_LRU_mutex = FALSE;
mutex_t* block_mutex;
if(UT_LIST_GET_LEN(buf_pool->unzip_LRU)) if(UT_LIST_GET_LEN(buf_pool->unzip_LRU))
have_LRU_mutex = TRUE; have_LRU_mutex = TRUE;
...@@ -1239,7 +1240,7 @@ buf_flush_LRU_recommendation(void) ...@@ -1239,7 +1240,7 @@ buf_flush_LRU_recommendation(void)
continue; continue;
} }
mutex_t* block_mutex = buf_page_get_mutex(bpage); block_mutex = buf_page_get_mutex(bpage);
retry_lock: retry_lock:
mutex_enter(block_mutex); mutex_enter(block_mutex);
......
...@@ -3039,6 +3039,13 @@ fil_open_single_table_tablespace( ...@@ -3039,6 +3039,13 @@ fil_open_single_table_tablespace(
ulint i; ulint i;
int len; int len;
ib_uint64_t current_lsn; ib_uint64_t current_lsn;
ulint size_low, size_high, size;
ib_int64_t size_bytes;
dict_table_t* table;
dict_index_t* index;
fil_system_t* system;
fil_node_t* node = NULL;
fil_space_t* space;
current_lsn = log_get_lsn(); current_lsn = log_get_lsn();
...@@ -3060,15 +3067,11 @@ fil_open_single_table_tablespace( ...@@ -3060,15 +3067,11 @@ fil_open_single_table_tablespace(
success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE); success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE);
/* get file size */ /* get file size */
ulint size_low, size_high, size;
ib_int64_t size_bytes;
os_file_get_size(file, &size_low, &size_high); os_file_get_size(file, &size_low, &size_high);
size_bytes = (((ib_int64_t)size_high) << 32) size_bytes = (((ib_int64_t)size_high) << 32)
+ (ib_int64_t)size_low; + (ib_int64_t)size_low;
/* get cruster index information */ /* get cruster index information */
dict_table_t* table;
dict_index_t* index;
table = dict_table_get_low(name); table = dict_table_get_low(name);
index = dict_table_get_first_index(table); index = dict_table_get_first_index(table);
ut_a(index->page==3); ut_a(index->page==3);
...@@ -3076,9 +3079,9 @@ fil_open_single_table_tablespace( ...@@ -3076,9 +3079,9 @@ fil_open_single_table_tablespace(
/* read metadata from .exp file */ /* read metadata from .exp file */
n_index = 0; n_index = 0;
bzero(old_id, sizeof(old_id)); memset(old_id, 0, sizeof(old_id));
bzero(new_id, sizeof(new_id)); memset(new_id, 0, sizeof(new_id));
bzero(root_page, sizeof(root_page)); memset(root_page, 0, sizeof(root_page));
info_file_path = fil_make_ibd_name(name, FALSE); info_file_path = fil_make_ibd_name(name, FALSE);
len = strlen(info_file_path); len = strlen(info_file_path);
...@@ -3128,9 +3131,9 @@ skip_info: ...@@ -3128,9 +3131,9 @@ skip_info:
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_; ulint* offsets = offsets_;
ib_int64_t offset;
size = (ulint) (size_bytes / UNIV_PAGE_SIZE); size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
/* over write space id of all pages */ /* over write space id of all pages */
ib_int64_t offset;
rec_offs_init(offsets_); rec_offs_init(offsets_);
...@@ -3284,10 +3287,8 @@ skip_info: ...@@ -3284,10 +3287,8 @@ skip_info:
} }
mem_free(info_file_path); mem_free(info_file_path);
fil_system_t* system = fil_system; system = fil_system;
mutex_enter(&(system->mutex)); mutex_enter(&(system->mutex));
fil_node_t* node = NULL;
fil_space_t* space;
space = fil_space_get_by_id(id); space = fil_space_get_by_id(id);
if (space) if (space)
node = UT_LIST_GET_FIRST(space->chain); node = UT_LIST_GET_FIRST(space->chain);
......
...@@ -25,26 +25,29 @@ This file contains accessor functions for dynamic plugin on Windows. ...@@ -25,26 +25,29 @@ This file contains accessor functions for dynamic plugin on Windows.
This is a list of externals that can not be resolved by delay loading. This is a list of externals that can not be resolved by delay loading.
They have to be resolved indirectly via their addresses in the .map file. They have to be resolved indirectly via their addresses in the .map file.
All of them are external variables. */ All of them are external variables. */
extern CHARSET_INFO* wdl_my_charset_bin; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
extern CHARSET_INFO* wdl_my_charset_latin1; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO* wdl_my_charset_filename; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
extern CHARSET_INFO** wdl_system_charset_info; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO* system_charset_info;
extern CHARSET_INFO** wdl_default_charset_info; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO* default_charset_info;
extern CHARSET_INFO** wdl_all_charsets; //extern MYSQL_PLUGIN_IMPORT CHARSET_INFO** all_charsets;
extern system_variables* wdl_global_system_variables; extern MYSQL_PLUGIN_IMPORT system_variables global_system_variables;
extern char* wdl_mysql_real_data_home; //extern MYSQL_PLUGIN_IMPORT char* mysql_real_data_home;
extern char** wdl_mysql_data_home; extern MYSQL_PLUGIN_IMPORT char* mysql_data_home;
extern char** wdl_tx_isolation_names; //extern MYSQL_PLUGIN_IMPORT char** tx_isolation_names;
extern char** wdl_binlog_format_names; //extern MYSQL_PLUGIN_IMPORT char** binlog_format_names;
extern char* wdl_reg_ext; //extern MYSQL_PLUGIN_IMPORT char reg_ext;
extern pthread_mutex_t* wdl_LOCK_thread_count; extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count;
extern key_map* wdl_key_map_full; extern MYSQL_PLUGIN_IMPORT key_map key_map_full;
extern MY_TMPDIR* wdl_mysql_tmpdir_list; extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
extern bool* wdl_mysqld_embedded; extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded;
extern uint* wdl_lower_case_table_names; extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names;
extern ulong* wdl_specialflag; extern MYSQL_PLUGIN_IMPORT ulong specialflag;
extern int* wdl_my_umask; extern MYSQL_PLUGIN_IMPORT int my_umask;
extern MYSQL_PLUGIN_IMPORT char *relay_log_info_file;
/*
#define my_charset_bin (*wdl_my_charset_bin) #define my_charset_bin (*wdl_my_charset_bin)
#define my_charset_latin1 (*wdl_my_charset_latin1) #define my_charset_latin1 (*wdl_my_charset_latin1)
#define my_charset_filename (*wdl_my_charset_filename) #define my_charset_filename (*wdl_my_charset_filename)
...@@ -61,8 +64,9 @@ extern int* wdl_my_umask; ...@@ -61,8 +64,9 @@ extern int* wdl_my_umask;
#define key_map_full (*wdl_key_map_full) #define key_map_full (*wdl_key_map_full)
#define mysql_tmpdir_list (*wdl_mysql_tmpdir_list) #define mysql_tmpdir_list (*wdl_mysql_tmpdir_list)
#define mysqld_embedded (*wdl_mysqld_embedded) #define mysqld_embedded (*wdl_mysqld_embedded)
#define lower_case_table_names (*wdl_lower_case_table_names) */
#define specialflag (*wdl_specialflag) //#define lower_case_table_names (*wdl_lower_case_table_names)
#define my_umask (*wdl_my_umask) //#define specialflag (*wdl_specialflag)
//#define my_umask (*wdl_my_umask)
#endif #endif
...@@ -795,7 +795,7 @@ i_s_innodb_buffer_pool_pages_index_fill( ...@@ -795,7 +795,7 @@ i_s_innodb_buffer_pool_pages_index_fill(
index = dict_index_get_if_in_cache_low(index_id); index = dict_index_get_if_in_cache_low(index_id);
if(index) if(index)
{ {
if((p = strchr(index->table_name, '/'))) if((p = (char*) strchr(index->table_name, '/')))
{ {
strncpy(db_name_raw, index->table_name, p-index->table_name); strncpy(db_name_raw, index->table_name, p-index->table_name);
db_name_raw[p-index->table_name] = 0; db_name_raw[p-index->table_name] = 0;
...@@ -2861,7 +2861,7 @@ i_s_innodb_index_stats_fill( ...@@ -2861,7 +2861,7 @@ i_s_innodb_index_stats_fill(
} else { } else {
rec_per_key = n_rows; rec_per_key = n_rows;
} }
snprintf(buff, 256, (i == index->n_uniq)?"%llu":"%llu, ", ut_snprintf(buff, 256, (i == index->n_uniq)?"%llu":"%llu, ",
rec_per_key); rec_per_key);
strncat(row_per_keys, buff, 256 - strlen(row_per_keys)); strncat(row_per_keys, buff, 256 - strlen(row_per_keys));
} }
......
...@@ -2693,12 +2693,10 @@ loop: ...@@ -2693,12 +2693,10 @@ loop:
/* defence line (max_checkpoint_age * 1/2) */ /* defence line (max_checkpoint_age * 1/2) */
ib_uint64_t lsn = log_sys->lsn; ib_uint64_t lsn = log_sys->lsn;
mutex_exit(&(log_sys->mutex));
ib_uint64_t level, bpl; ib_uint64_t level, bpl;
buf_page_t* bpage; buf_page_t* bpage;
mutex_exit(&(log_sys->mutex));
mutex_enter(&flush_list_mutex); mutex_enter(&flush_list_mutex);
level = 0; level = 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