summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-04-21 08:45:48 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-04-21 18:04:02 +0300
commit47141c9d9b5170bb8e6a401f4456a4d759688fe3 (patch)
treed01797ed9c169f15a3545c9a846e383c25c746cb /storage
parent5684aa220cc4415fe8ee31ac044210b9ff8c7ce1 (diff)
downloadmariadb-git-47141c9d9b5170bb8e6a401f4456a4d759688fe3.tar.gz
Fix some InnoDB type mismatch
On 64-bit Windows, sizeof(ulint)!=sizeof(ulong).
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/buf/buf0buf.cc32
-rw-r--r--storage/innobase/buf/buf0dblwr.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc4
-rw-r--r--storage/innobase/fil/fil0crypt.cc21
-rw-r--r--storage/innobase/fil/fil0fil.cc3
-rw-r--r--storage/innobase/fil/fil0pagecompress.cc5
-rw-r--r--storage/innobase/row/row0ftsort.cc7
7 files changed, 39 insertions, 37 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 1ddd4c483e1..8a56683ff5c 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -7107,24 +7107,22 @@ buf_print_io_instance(
pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) {
- double hit_rate = ((1000 * pool_info->page_read_delta)
- / pool_info->n_page_get_delta);
+ double hit_rate = double(pool_info->page_read_delta)
+ / pool_info->n_page_get_delta;
- if (hit_rate > 1000) {
- hit_rate = 1000;
+ if (hit_rate > 1) {
+ hit_rate = 1;
}
- hit_rate = 1000 - hit_rate;
-
fprintf(file,
"Buffer pool hit rate " ULINTPF " / 1000,"
" young-making rate " ULINTPF " / 1000 not "
ULINTPF " / 1000\n",
- (ulint) hit_rate,
- (ulint) (1000 * pool_info->young_making_delta
- / pool_info->n_page_get_delta),
- (ulint) (1000 * pool_info->not_young_making_delta
- / pool_info->n_page_get_delta));
+ ulint(1000 * (1 - hit_rate)),
+ ulint(1000 * double(pool_info->young_making_delta)
+ / pool_info->n_page_get_delta),
+ ulint(1000 * double(pool_info->not_young_making_delta)
+ / pool_info->n_page_get_delta));
} else {
fputs("No buffer pool page gets since the last printout\n",
file);
@@ -7556,9 +7554,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage)
/* decompress using comp_buf to dst_frame */
fil_decompress_page(slot->comp_buf,
- dst_frame,
- size.logical(),
- &bpage->write_size);
+ dst_frame,
+ ulong(size.logical()),
+ &bpage->write_size);
/* Mark this slot as free */
slot->reserved = false;
@@ -7603,9 +7601,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage)
ut_d(fil_page_type_validate(dst_frame));
/* decompress using comp_buf to dst_frame */
fil_decompress_page(slot->comp_buf,
- dst_frame,
- size.logical(),
- &bpage->write_size);
+ dst_frame,
+ ulong(size.logical()),
+ &bpage->write_size);
ut_d(fil_page_type_validate(dst_frame));
}
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index fcf6d55f660..6a0179f36ad 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -595,7 +595,7 @@ buf_dblwr_process(void)
/* Decompress the page before
validating the checksum. */
fil_decompress_page(
- NULL, read_buf, UNIV_PAGE_SIZE,
+ NULL, read_buf, srv_page_size,
NULL, true);
}
@@ -621,7 +621,7 @@ buf_dblwr_process(void)
/* Decompress the page before
validating the checksum. */
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,
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 06f68fbf6bd..c6420129164 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -6746,7 +6746,7 @@ dict_fs2utf8(
strconvert(
&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 */
const char* table = dict_remove_db_name(db_and_table);
@@ -6773,7 +6773,7 @@ dict_fs2utf8(
strconvert(
&my_charset_filename, buf, (uint) (buf_p - buf),
system_charset_info,
- table_utf8, table_utf8_size,
+ table_utf8, uint(table_utf8_size),
&errors);
if (errors != 0) {
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);
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 9aca879fa1a..2adf32b79d9 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1480,10 +1480,9 @@ row_fts_build_sel_tree_level(
int child_left;
int child_right;
ulint i;
- ulint num_item;
+ ulint num_item = ulint(1) << level;
- start = static_cast<ulint>((1 << level) - 1);
- num_item = static_cast<ulint>(1 << level);
+ start = num_item - 1;
for (i = 0; i < num_item; i++) {
child_left = sel_tree[(start + i) * 2 + 1];
@@ -1552,7 +1551,7 @@ row_fts_build_sel_tree(
treelevel++;
}
- start = (1 << treelevel) - 1;
+ start = (ulint(1) << treelevel) - 1;
for (i = 0; i < (int) fts_sort_pll_degree; i++) {
sel_tree[i + start] = i;