diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-04-21 08:45:48 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-04-21 18:04:02 +0300 |
commit | 47141c9d9b5170bb8e6a401f4456a4d759688fe3 (patch) | |
tree | d01797ed9c169f15a3545c9a846e383c25c746cb /storage/innobase/fil | |
parent | 5684aa220cc4415fe8ee31ac044210b9ff8c7ce1 (diff) | |
download | mariadb-git-47141c9d9b5170bb8e6a401f4456a4d759688fe3.tar.gz |
Fix some InnoDB type mismatch
On 64-bit Windows, sizeof(ulint)!=sizeof(ulong).
Diffstat (limited to 'storage/innobase/fil')
-rw-r--r-- | storage/innobase/fil/fil0crypt.cc | 21 | ||||
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 3 | ||||
-rw-r--r-- | storage/innobase/fil/fil0pagecompress.cc | 5 |
3 files changed, 17 insertions, 12 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 5ad91759d89..e9e840e7468 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -647,7 +647,8 @@ fil_space_encrypt( comp_mem = (byte *)malloc(UNIV_PAGE_SIZE); uncomp_mem = (byte *)malloc(UNIV_PAGE_SIZE); memcpy(comp_mem, src_frame, UNIV_PAGE_SIZE); - fil_decompress_page(uncomp_mem, comp_mem, page_size.physical(), NULL); + fil_decompress_page(uncomp_mem, comp_mem, + srv_page_size, NULL); src = uncomp_mem; } @@ -657,7 +658,8 @@ fil_space_encrypt( /* Need to decompress the page if it was also compressed */ if (page_compressed_encrypted) { memcpy(comp_mem, tmp_mem, UNIV_PAGE_SIZE); - fil_decompress_page(tmp_mem, comp_mem, page_size.physical(), NULL); + fil_decompress_page(tmp_mem, comp_mem, + srv_page_size, NULL); } bool corrupted = buf_page_is_corrupted(true, tmp_mem, page_size, space); @@ -1306,20 +1308,21 @@ fil_crypt_realloc_iops( if (10 * state->cnt_waited > state->batch) { /* if we waited more than 10% re-estimate max_iops */ - uint avg_wait_time_us = + ulint avg_wait_time_us = state->sum_waited_us / state->cnt_waited; + if (avg_wait_time_us == 0) { + avg_wait_time_us = 1; // prevent division by zero + } + DBUG_PRINT("ib_crypt", - ("thr_no: %u - update estimated_max_iops from %u to %u.", + ("thr_no: %u - update estimated_max_iops from %u to " + ULINTPF ".", state->thread_no, state->estimated_max_iops, 1000000 / avg_wait_time_us)); - if (avg_wait_time_us == 0) { - avg_wait_time_us = 1; // prevent division by zero - } - - state->estimated_max_iops = 1000000 / avg_wait_time_us; + state->estimated_max_iops = uint(1000000 / avg_wait_time_us); state->cnt_waited = 0; state->sum_waited_us = 0; } else { diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 806c2d4ed7f..b4a879d0f61 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -5892,7 +5892,8 @@ fil_iterate( /* If the original page is page_compressed, we need to decompress page before we can update it. */ if (page_compressed) { - fil_decompress_page(NULL, dst, size, NULL); + fil_decompress_page(NULL, dst, ulong(size), + NULL); updated = true; } diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index e9a9a0c59a0..dad74ce34f2 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -253,7 +253,8 @@ fil_compress_page( #endif /* HAVE_SNAPPY */ case PAGE_ZLIB_ALGORITHM: - err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, comp_level); + err = compress2(out_buf+header_len, (ulong*)&write_size, buf, + uLong(len), comp_level); if (err != Z_OK) { goto err_exit; @@ -308,7 +309,7 @@ fil_compress_page( bool tsfound; const page_size_t page_size = fil_space_get_page_size(space_id, &tsfound); - fil_decompress_page(uncomp_page, comp_page, len, NULL); + fil_decompress_page(uncomp_page, comp_page, ulong(len), NULL); if (buf_page_is_corrupted(false, uncomp_page, page_size, space)) { buf_page_print(uncomp_page, page_size, 0); |