Commit 47141c9d authored by Marko Mäkelä's avatar Marko Mäkelä

Fix some InnoDB type mismatch

On 64-bit Windows, sizeof(ulint)!=sizeof(ulong).
parent 5684aa22
...@@ -7107,24 +7107,22 @@ buf_print_io_instance( ...@@ -7107,24 +7107,22 @@ buf_print_io_instance(
pool_info->pages_written_rate); pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) { if (pool_info->n_page_get_delta) {
double hit_rate = ((1000 * pool_info->page_read_delta) double hit_rate = double(pool_info->page_read_delta)
/ pool_info->n_page_get_delta); / pool_info->n_page_get_delta;
if (hit_rate > 1000) { if (hit_rate > 1) {
hit_rate = 1000; hit_rate = 1;
} }
hit_rate = 1000 - hit_rate;
fprintf(file, fprintf(file,
"Buffer pool hit rate " ULINTPF " / 1000," "Buffer pool hit rate " ULINTPF " / 1000,"
" young-making rate " ULINTPF " / 1000 not " " young-making rate " ULINTPF " / 1000 not "
ULINTPF " / 1000\n", ULINTPF " / 1000\n",
(ulint) hit_rate, ulint(1000 * (1 - hit_rate)),
(ulint) (1000 * pool_info->young_making_delta ulint(1000 * double(pool_info->young_making_delta)
/ pool_info->n_page_get_delta), / pool_info->n_page_get_delta),
(ulint) (1000 * pool_info->not_young_making_delta ulint(1000 * double(pool_info->not_young_making_delta)
/ pool_info->n_page_get_delta)); / pool_info->n_page_get_delta));
} else { } else {
fputs("No buffer pool page gets since the last printout\n", fputs("No buffer pool page gets since the last printout\n",
file); file);
...@@ -7556,9 +7554,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage) ...@@ -7556,9 +7554,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage)
/* decompress using comp_buf to dst_frame */ /* decompress using comp_buf to dst_frame */
fil_decompress_page(slot->comp_buf, fil_decompress_page(slot->comp_buf,
dst_frame, dst_frame,
size.logical(), ulong(size.logical()),
&bpage->write_size); &bpage->write_size);
/* Mark this slot as free */ /* Mark this slot as free */
slot->reserved = false; slot->reserved = false;
...@@ -7603,9 +7601,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage) ...@@ -7603,9 +7601,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage)
ut_d(fil_page_type_validate(dst_frame)); ut_d(fil_page_type_validate(dst_frame));
/* decompress using comp_buf to dst_frame */ /* decompress using comp_buf to dst_frame */
fil_decompress_page(slot->comp_buf, fil_decompress_page(slot->comp_buf,
dst_frame, dst_frame,
size.logical(), ulong(size.logical()),
&bpage->write_size); &bpage->write_size);
ut_d(fil_page_type_validate(dst_frame)); ut_d(fil_page_type_validate(dst_frame));
} }
......
...@@ -595,7 +595,7 @@ buf_dblwr_process(void) ...@@ -595,7 +595,7 @@ buf_dblwr_process(void)
/* Decompress the page before /* Decompress the page before
validating the checksum. */ validating the checksum. */
fil_decompress_page( fil_decompress_page(
NULL, read_buf, UNIV_PAGE_SIZE, NULL, read_buf, srv_page_size,
NULL, true); NULL, true);
} }
...@@ -621,7 +621,7 @@ buf_dblwr_process(void) ...@@ -621,7 +621,7 @@ buf_dblwr_process(void)
/* Decompress the page before /* Decompress the page before
validating the checksum. */ validating the checksum. */
fil_decompress_page( fil_decompress_page(
NULL, page, UNIV_PAGE_SIZE, NULL, true); NULL, page, srv_page_size, NULL, true);
} }
if (!fil_space_verify_crypt_checksum(page, page_size, if (!fil_space_verify_crypt_checksum(page, page_size,
......
...@@ -6746,7 +6746,7 @@ dict_fs2utf8( ...@@ -6746,7 +6746,7 @@ dict_fs2utf8(
strconvert( strconvert(
&my_charset_filename, db, db_len, system_charset_info, &my_charset_filename, db, db_len, system_charset_info,
db_utf8, db_utf8_size, &errors); db_utf8, uint(db_utf8_size), &errors);
/* convert each # to @0023 in table name and store the result in buf */ /* convert each # to @0023 in table name and store the result in buf */
const char* table = dict_remove_db_name(db_and_table); const char* table = dict_remove_db_name(db_and_table);
...@@ -6773,7 +6773,7 @@ dict_fs2utf8( ...@@ -6773,7 +6773,7 @@ dict_fs2utf8(
strconvert( strconvert(
&my_charset_filename, buf, (uint) (buf_p - buf), &my_charset_filename, buf, (uint) (buf_p - buf),
system_charset_info, system_charset_info,
table_utf8, table_utf8_size, table_utf8, uint(table_utf8_size),
&errors); &errors);
if (errors != 0) { if (errors != 0) {
......
...@@ -647,7 +647,8 @@ fil_space_encrypt( ...@@ -647,7 +647,8 @@ fil_space_encrypt(
comp_mem = (byte *)malloc(UNIV_PAGE_SIZE); comp_mem = (byte *)malloc(UNIV_PAGE_SIZE);
uncomp_mem = (byte *)malloc(UNIV_PAGE_SIZE); uncomp_mem = (byte *)malloc(UNIV_PAGE_SIZE);
memcpy(comp_mem, src_frame, 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; src = uncomp_mem;
} }
...@@ -657,7 +658,8 @@ fil_space_encrypt( ...@@ -657,7 +658,8 @@ fil_space_encrypt(
/* Need to decompress the page if it was also compressed */ /* Need to decompress the page if it was also compressed */
if (page_compressed_encrypted) { if (page_compressed_encrypted) {
memcpy(comp_mem, tmp_mem, UNIV_PAGE_SIZE); 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); bool corrupted = buf_page_is_corrupted(true, tmp_mem, page_size, space);
...@@ -1306,20 +1308,21 @@ fil_crypt_realloc_iops( ...@@ -1306,20 +1308,21 @@ fil_crypt_realloc_iops(
if (10 * state->cnt_waited > state->batch) { if (10 * state->cnt_waited > state->batch) {
/* if we waited more than 10% re-estimate max_iops */ /* 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; 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", 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->thread_no,
state->estimated_max_iops, state->estimated_max_iops,
1000000 / avg_wait_time_us)); 1000000 / avg_wait_time_us));
if (avg_wait_time_us == 0) { state->estimated_max_iops = uint(1000000 / avg_wait_time_us);
avg_wait_time_us = 1; // prevent division by zero
}
state->estimated_max_iops = 1000000 / avg_wait_time_us;
state->cnt_waited = 0; state->cnt_waited = 0;
state->sum_waited_us = 0; state->sum_waited_us = 0;
} else { } else {
......
...@@ -5892,7 +5892,8 @@ fil_iterate( ...@@ -5892,7 +5892,8 @@ fil_iterate(
/* If the original page is page_compressed, we need /* If the original page is page_compressed, we need
to decompress page before we can update it. */ to decompress page before we can update it. */
if (page_compressed) { if (page_compressed) {
fil_decompress_page(NULL, dst, size, NULL); fil_decompress_page(NULL, dst, ulong(size),
NULL);
updated = true; updated = true;
} }
......
...@@ -253,7 +253,8 @@ fil_compress_page( ...@@ -253,7 +253,8 @@ fil_compress_page(
#endif /* HAVE_SNAPPY */ #endif /* HAVE_SNAPPY */
case PAGE_ZLIB_ALGORITHM: 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) { if (err != Z_OK) {
goto err_exit; goto err_exit;
...@@ -308,7 +309,7 @@ fil_compress_page( ...@@ -308,7 +309,7 @@ fil_compress_page(
bool tsfound; bool tsfound;
const page_size_t page_size = fil_space_get_page_size(space_id, &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)) { if (buf_page_is_corrupted(false, uncomp_page, page_size, space)) {
buf_page_print(uncomp_page, page_size, 0); buf_page_print(uncomp_page, page_size, 0);
......
...@@ -1480,10 +1480,9 @@ row_fts_build_sel_tree_level( ...@@ -1480,10 +1480,9 @@ row_fts_build_sel_tree_level(
int child_left; int child_left;
int child_right; int child_right;
ulint i; ulint i;
ulint num_item; ulint num_item = ulint(1) << level;
start = static_cast<ulint>((1 << level) - 1); start = num_item - 1;
num_item = static_cast<ulint>(1 << level);
for (i = 0; i < num_item; i++) { for (i = 0; i < num_item; i++) {
child_left = sel_tree[(start + i) * 2 + 1]; child_left = sel_tree[(start + i) * 2 + 1];
...@@ -1552,7 +1551,7 @@ row_fts_build_sel_tree( ...@@ -1552,7 +1551,7 @@ row_fts_build_sel_tree(
treelevel++; treelevel++;
} }
start = (1 << treelevel) - 1; start = (ulint(1) << treelevel) - 1;
for (i = 0; i < (int) fts_sort_pll_degree; i++) { for (i = 0; i < (int) fts_sort_pll_degree; i++) {
sel_tree[i + start] = i; sel_tree[i + start] = i;
......
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