At file:///home/psergey/dev/maria-5.1-fixwindows/ ------------------------------------------------------------ revno: 2723 revision-id: psergey@askmonty.org-20090901115954-nge2brzh3akkmtlz parent: knielsen@knielsen-hq.org-20090831112339-td6t7ljy4w2oamvt committer: Sergey Petrunya <psergey@askmonty.org> branch nick: maria-5.1-fixwindows timestamp: Tue 2009-09-01 15:59:54 +0400 message: Trivial fixes for windows compile failures - Add strmov_overlapp.c where it's needed - Add libevent where it is required - Fix typo in unittest/mysys/waiting_threads-t.c - fix xtradb C language source so that they have variable declarations before any operators, as it is (or was?) required in C. === modified file 'libmysql/CMakeLists.txt' --- a/libmysql/CMakeLists.txt 2008-04-28 16:24:05 +0000 +++ b/libmysql/CMakeLists.txt 2009-09-01 11:59:54 +0000 @@ -94,7 +94,7 @@ ../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c ../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c ../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c - ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c + ../strings/strmov.c ../strings/strmov_overlapp.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c === modified file 'sql/CMakeLists.txt' --- a/sql/CMakeLists.txt 2008-11-21 14:21:50 +0000 +++ b/sql/CMakeLists.txt 2009-09-01 11:59:54 +0000 @@ -25,6 +25,7 @@ ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/zlib + ${CMAKE_SOURCE_DIR}/extra/libevent ) SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h @@ -85,7 +86,7 @@ TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib debug dbug yassl - taocrypt strings vio regex wsock32 ws2_32) + taocrypt strings vio regex libevent wsock32 ws2_32) SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX}) @@ -139,7 +140,7 @@ # Gen_lex_hash ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) -TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient wsock32) +TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient strings wsock32) GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION) ADD_CUSTOM_COMMAND( OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h === 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-01 11:59:54 +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-01 11:59:54 +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-06-25 01:43:25 +0000 +++ b/storage/xtradb/buf/buf0flu.c 2009-09-01 11:59:54 +0000 @@ -1106,11 +1106,13 @@ page_count += buf_flush_try_neighbors( space, offset, flush_type); } else { + mutex_t* block_mutex; + buf_page_t* bpage_tmp; /* Try to flush the page only */ //buf_pool_mutex_enter(); rw_lock_s_lock(&page_hash_latch); - mutex_t* block_mutex = buf_page_get_mutex(bpage); + block_mutex = buf_page_get_mutex(bpage); retry_lock_2: mutex_enter(block_mutex); if (block_mutex != buf_page_get_mutex(bpage)) { @@ -1119,7 +1121,7 @@ goto retry_lock_2; } - buf_page_t* bpage_tmp = buf_page_hash_get(space, offset); + bpage_tmp = buf_page_hash_get(space, offset); if (bpage_tmp) { buf_flush_page(bpage_tmp, flush_type); page_count++; @@ -1238,13 +1240,14 @@ + BUF_FLUSH_EXTRA_MARGIN) && (distance < BUF_LRU_FREE_SEARCH_LEN)) { - if (!bpage->in_LRU_list) { + mutex_t* block_mutex; + if (!bpage->in_LRU_list) { /* reatart. but it is very optimistic */ bpage = UT_LIST_GET_LAST(buf_pool->LRU); 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-01 11:59:54 +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/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-01 11:59:54 +0000 @@ -763,7 +763,7 @@ dict_index_t* index; dulint index_id; - char *p; + const char *p; char db_name_raw[NAME_LEN*5+1], db_name[NAME_LEN+1]; char table_name_raw[NAME_LEN*5+1], table_name[NAME_LEN+1]; @@ -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-07-06 05:47:15 +0000 +++ b/storage/xtradb/srv/srv0srv.c 2009-09-01 11:59:54 +0000 @@ -2693,11 +2693,11 @@ /* 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; === modified file 'strings/CMakeLists.txt' --- a/strings/CMakeLists.txt 2008-10-10 15:28:41 +0000 +++ b/strings/CMakeLists.txt 2009-09-01 11:59:54 +0000 @@ -23,7 +23,7 @@ ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c - str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c + str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strmov_overlapp.c strnmov.c strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c my_strchr.c strcont.c strinstr.c strnlen.c strappend.c) === modified file 'unittest/mysys/waiting_threads-t.c' --- a/unittest/mysys/waiting_threads-t.c 2009-03-20 11:41:30 +0000 +++ b/unittest/mysys/waiting_threads-t.c 2009-09-01 11:59:54 +0000 @@ -263,6 +263,7 @@ kill_strategy=X; \ do_one_test(); #else +#define test_kill_strategy(X) \ diag("kill strategy: " #X); \ DBUG_PRINT("info", ("kill strategy: " #X)); \ kill_strategy=X; \