Commit d841ea23 authored by Sergey Petrunya's avatar Sergey Petrunya

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.

libmysql/CMakeLists.txt:
  - Add strmov_overlapp.c where it's needed
sql/CMakeLists.txt:
  - Add strmov_overlapp.c where it's needed
  - Add libevent where it is required
storage/xtradb/btr/btr0cur.c:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
storage/xtradb/buf/buf0buddy.c:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
storage/xtradb/buf/buf0flu.c:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
storage/xtradb/fil/fil0fil.c:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
storage/xtradb/handler/i_s.cc:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
storage/xtradb/srv/srv0srv.c:
  - fix xtradb C language source so that they have variable declarations before
    any operators, as it is (or was?) required in C.
strings/CMakeLists.txt:
  - Add strmov_overlapp.c where it's needed
unittest/mysys/waiting_threads-t.c:
  - Fix typo in unittest/mysys/waiting_threads-t.c
parent 177f0249
...@@ -94,7 +94,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ...@@ -94,7 +94,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c ../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c
../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.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/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 ../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 ../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 ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
......
...@@ -25,6 +25,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -25,6 +25,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/libevent
) )
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
...@@ -85,7 +86,7 @@ ADD_EXECUTABLE(mysqld ...@@ -85,7 +86,7 @@ ADD_EXECUTABLE(mysqld
TARGET_LINK_LIBRARIES(mysqld TARGET_LINK_LIBRARIES(mysqld
heap myisam myisammrg mysys yassl zlib debug dbug yassl 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}) SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
...@@ -139,7 +140,7 @@ ADD_CUSTOM_COMMAND( ...@@ -139,7 +140,7 @@ ADD_CUSTOM_COMMAND(
# Gen_lex_hash # Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) 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) GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
......
...@@ -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);
......
...@@ -1106,11 +1106,13 @@ retry_lock_1: ...@@ -1106,11 +1106,13 @@ retry_lock_1:
page_count += buf_flush_try_neighbors( page_count += buf_flush_try_neighbors(
space, offset, flush_type); space, offset, flush_type);
} else { } else {
mutex_t* block_mutex;
buf_page_t* bpage_tmp;
/* Try to flush the page only */ /* Try to flush the page only */
//buf_pool_mutex_enter(); //buf_pool_mutex_enter();
rw_lock_s_lock(&page_hash_latch); 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: retry_lock_2:
mutex_enter(block_mutex); mutex_enter(block_mutex);
if (block_mutex != buf_page_get_mutex(bpage)) { if (block_mutex != buf_page_get_mutex(bpage)) {
...@@ -1119,7 +1121,7 @@ retry_lock_2: ...@@ -1119,7 +1121,7 @@ retry_lock_2:
goto retry_lock_2; 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) { if (bpage_tmp) {
buf_flush_page(bpage_tmp, flush_type); buf_flush_page(bpage_tmp, flush_type);
page_count++; page_count++;
...@@ -1238,13 +1240,14 @@ buf_flush_LRU_recommendation(void) ...@@ -1238,13 +1240,14 @@ buf_flush_LRU_recommendation(void)
+ BUF_FLUSH_EXTRA_MARGIN) + BUF_FLUSH_EXTRA_MARGIN)
&& (distance < BUF_LRU_FREE_SEARCH_LEN)) { && (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 */ /* reatart. but it is very optimistic */
bpage = UT_LIST_GET_LAST(buf_pool->LRU); bpage = UT_LIST_GET_LAST(buf_pool->LRU);
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);
......
...@@ -763,7 +763,7 @@ i_s_innodb_buffer_pool_pages_index_fill( ...@@ -763,7 +763,7 @@ i_s_innodb_buffer_pool_pages_index_fill(
dict_index_t* index; dict_index_t* index;
dulint index_id; dulint index_id;
char *p; const char *p;
char db_name_raw[NAME_LEN*5+1], db_name[NAME_LEN+1]; 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]; char table_name_raw[NAME_LEN*5+1], table_name[NAME_LEN+1];
...@@ -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,11 +2693,11 @@ loop: ...@@ -2693,11 +2693,11 @@ 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;
......
...@@ -23,7 +23,7 @@ SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ...@@ -23,7 +23,7 @@ SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c 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 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 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 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 my_strchr.c strcont.c strinstr.c strnlen.c
strappend.c) strappend.c)
......
...@@ -263,6 +263,7 @@ void do_tests() ...@@ -263,6 +263,7 @@ void do_tests()
kill_strategy=X; \ kill_strategy=X; \
do_one_test(); do_one_test();
#else #else
#define test_kill_strategy(X) \
diag("kill strategy: " #X); \ diag("kill strategy: " #X); \
DBUG_PRINT("info", ("kill strategy: " #X)); \ DBUG_PRINT("info", ("kill strategy: " #X)); \
kill_strategy=X; \ kill_strategy=X; \
......
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