[Maria-developers] Rev 2732: Make MariaDB work on windows: in file:///home/psergey/bzr-new/mysql-5.1-maria-contd3/
At file:///home/psergey/bzr-new/mysql-5.1-maria-contd3/ ------------------------------------------------------------ revno: 2732 revision-id: psergey@askmonty.org-20090915010415-ntacv5ln6fqyb202 parent: psergey@askmonty.org-20090914225219-dlevkjuu61j32vge committer: Sergey Petrunya <psergey@askmonty.org> branch nick: mysql-5.1-maria-contd3 timestamp: Tue 2009-09-15 05:04:15 +0400 message: Make MariaDB work on windows: - fix xtradb compile failures on windows (why do we have to do it again?) === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2009-09-07 20:50:10 +0000 +++ b/sql/mysqld.cc 2009-09-15 01:04:15 +0000 @@ -663,7 +663,8 @@ uint report_port= MYSQL_PORT; ulong master_retry_count=0; 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; my_bool master_ssl; char *master_ssl_key, *master_ssl_cert; === modified file 'sql/slave.h' --- a/sql/slave.h 2009-09-07 20:50:10 +0000 +++ b/sql/slave.h 2009-09-15 01:04:15 +0000 @@ -101,7 +101,8 @@ extern char slave_skip_error_names[]; extern bool use_slave_mask; 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 my_bool opt_skip_slave_start, opt_reckless_slave; extern my_bool opt_log_slave_updates; @@ -205,7 +206,7 @@ /* the master variables are defaults read from my.cnf or command line */ extern uint master_port, master_connect_retry, report_port; 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 my_bool master_ssl; === modified file 'storage/innobase/CMakeLists.txt' --- a/storage/innobase/CMakeLists.txt 2009-06-10 08:59:49 +0000 +++ b/storage/innobase/CMakeLists.txt 2009-09-15 01:04:15 +0000 @@ -63,5 +63,5 @@ 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) -MYSQL_STORAGE_ENGINE(INNOBASE) + ## psergey: MYSQL_STORAGE_ENGINE(INNOBASE) === modified file 'storage/xtradb/CMakeLists.txt' --- a/storage/xtradb/CMakeLists.txt 2009-08-03 20:09:53 +0000 +++ b/storage/xtradb/CMakeLists.txt 2009-09-15 01:04:15 +0000 @@ -15,7 +15,8 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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) # Removing Win64 compiler optimizations for all innodb/mem/* files. @@ -66,32 +67,5 @@ 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) -IF(NOT SOURCE_SUBLIBS) - 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) +MYSQL_STORAGE_ENGINE(INNOBASE) + === modified file 'storage/xtradb/btr/btr0cur.c' --- a/storage/xtradb/btr/btr0cur.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/btr/btr0cur.c 2009-09-15 01:04:15 +0000 @@ -3267,6 +3267,7 @@ } while (rec != supremum) { + rec_t* next_rec; /* count recs */ if (stats_method == SRV_STATS_METHOD_IGNORE_NULLS) { n_recs++; @@ -3281,7 +3282,7 @@ } } - rec_t* next_rec = page_rec_get_next(rec); + next_rec = page_rec_get_next(rec); if (next_rec == supremum) { break; } === modified file 'storage/xtradb/buf/buf0buddy.c' --- a/storage/xtradb/buf/buf0buddy.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/buf/buf0buddy.c 2009-09-15 01:04:15 +0000 @@ -461,11 +461,11 @@ actually is a properly initialized buf_page_t object. */ if (size >= PAGE_ZIP_MIN_SIZE) { + mutex_t* mutex; if (!have_page_hash_mutex) mutex_exit(&zip_free_mutex); /* This is a compressed page. */ - mutex_t* mutex; if (!have_page_hash_mutex) { mutex_enter(&LRU_list_mutex); === modified file 'storage/xtradb/buf/buf0flu.c' --- a/storage/xtradb/buf/buf0flu.c 2009-08-09 07:04:58 +0000 +++ b/storage/xtradb/buf/buf0flu.c 2009-09-15 01:04:15 +0000 @@ -1216,6 +1216,7 @@ ulint n_replaceable; ulint distance = 0; ibool have_LRU_mutex = FALSE; + mutex_t* block_mutex; if(UT_LIST_GET_LEN(buf_pool->unzip_LRU)) have_LRU_mutex = TRUE; @@ -1239,7 +1240,7 @@ continue; } - mutex_t* block_mutex = buf_page_get_mutex(bpage); + block_mutex = buf_page_get_mutex(bpage); retry_lock: mutex_enter(block_mutex); === modified file 'storage/xtradb/fil/fil0fil.c' --- a/storage/xtradb/fil/fil0fil.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/fil/fil0fil.c 2009-09-15 01:04:15 +0000 @@ -3039,6 +3039,13 @@ ulint i; int len; 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(); @@ -3060,15 +3067,11 @@ success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE); /* get file size */ - ulint size_low, size_high, size; - ib_int64_t size_bytes; os_file_get_size(file, &size_low, &size_high); size_bytes = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; /* get cruster index information */ - dict_table_t* table; - dict_index_t* index; table = dict_table_get_low(name); index = dict_table_get_first_index(table); ut_a(index->page==3); @@ -3076,9 +3079,9 @@ /* read metadata from .exp file */ n_index = 0; - bzero(old_id, sizeof(old_id)); - bzero(new_id, sizeof(new_id)); - bzero(root_page, sizeof(root_page)); + memset(old_id, 0, sizeof(old_id)); + memset(new_id, 0, sizeof(new_id)); + memset(root_page, 0, sizeof(root_page)); info_file_path = fil_make_ibd_name(name, FALSE); len = strlen(info_file_path); @@ -3128,9 +3131,9 @@ mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; + ib_int64_t offset; size = (ulint) (size_bytes / UNIV_PAGE_SIZE); /* over write space id of all pages */ - ib_int64_t offset; rec_offs_init(offsets_); @@ -3284,10 +3287,8 @@ } mem_free(info_file_path); - fil_system_t* system = fil_system; + system = fil_system; mutex_enter(&(system->mutex)); - fil_node_t* node = NULL; - fil_space_t* space; space = fil_space_get_by_id(id); if (space) node = UT_LIST_GET_FIRST(space->chain); === modified file 'storage/xtradb/handler/handler0vars.h' --- a/storage/xtradb/handler/handler0vars.h 2009-03-26 06:11:11 +0000 +++ b/storage/xtradb/handler/handler0vars.h 2009-09-15 01:04:15 +0000 @@ -25,26 +25,29 @@ 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. All of them are external variables. */ -extern CHARSET_INFO* wdl_my_charset_bin; -extern CHARSET_INFO* wdl_my_charset_latin1; -extern CHARSET_INFO* wdl_my_charset_filename; -extern CHARSET_INFO** wdl_system_charset_info; -extern CHARSET_INFO** wdl_default_charset_info; -extern CHARSET_INFO** wdl_all_charsets; -extern system_variables* wdl_global_system_variables; -extern char* wdl_mysql_real_data_home; -extern char** wdl_mysql_data_home; -extern char** wdl_tx_isolation_names; -extern char** wdl_binlog_format_names; -extern char* wdl_reg_ext; -extern pthread_mutex_t* wdl_LOCK_thread_count; -extern key_map* wdl_key_map_full; -extern MY_TMPDIR* wdl_mysql_tmpdir_list; -extern bool* wdl_mysqld_embedded; -extern uint* wdl_lower_case_table_names; -extern ulong* wdl_specialflag; -extern int* wdl_my_umask; - +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO* system_charset_info; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO* default_charset_info; +//extern MYSQL_PLUGIN_IMPORT CHARSET_INFO** all_charsets; +extern MYSQL_PLUGIN_IMPORT system_variables global_system_variables; +//extern MYSQL_PLUGIN_IMPORT char* mysql_real_data_home; +extern MYSQL_PLUGIN_IMPORT char* mysql_data_home; +//extern MYSQL_PLUGIN_IMPORT char** tx_isolation_names; +//extern MYSQL_PLUGIN_IMPORT char** binlog_format_names; +//extern MYSQL_PLUGIN_IMPORT char reg_ext; +extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count; +extern MYSQL_PLUGIN_IMPORT key_map key_map_full; +extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list; +extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded; +extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names; +extern MYSQL_PLUGIN_IMPORT ulong specialflag; +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_latin1 (*wdl_my_charset_latin1) #define my_charset_filename (*wdl_my_charset_filename) @@ -61,8 +64,9 @@ #define key_map_full (*wdl_key_map_full) #define mysql_tmpdir_list (*wdl_mysql_tmpdir_list) #define mysqld_embedded (*wdl_mysqld_embedded) -#define lower_case_table_names (*wdl_lower_case_table_names) -#define specialflag (*wdl_specialflag) -#define my_umask (*wdl_my_umask) +*/ +//#define lower_case_table_names (*wdl_lower_case_table_names) +//#define specialflag (*wdl_specialflag) +//#define my_umask (*wdl_my_umask) #endif === modified file 'storage/xtradb/handler/i_s.cc' --- a/storage/xtradb/handler/i_s.cc 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/handler/i_s.cc 2009-09-15 01:04:15 +0000 @@ -795,7 +795,7 @@ index = dict_index_get_if_in_cache_low(index_id); 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); db_name_raw[p-index->table_name] = 0; @@ -2861,7 +2861,7 @@ } else { 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); strncat(row_per_keys, buff, 256 - strlen(row_per_keys)); } === modified file 'storage/xtradb/srv/srv0srv.c' --- a/storage/xtradb/srv/srv0srv.c 2009-09-08 16:04:58 +0000 +++ b/storage/xtradb/srv/srv0srv.c 2009-09-15 01:04:15 +0000 @@ -2693,12 +2693,10 @@ /* defence line (max_checkpoint_age * 1/2) */ ib_uint64_t lsn = log_sys->lsn; - - mutex_exit(&(log_sys->mutex)); - ib_uint64_t level, bpl; buf_page_t* bpage; + mutex_exit(&(log_sys->mutex)); mutex_enter(&flush_list_mutex); level = 0;
participants (1)
-
Sergey Petrunya