summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/buf/buf0buf.cc25
-rw-r--r--storage/innobase/os/os0file.cc4
-rw-r--r--storage/innobase/row/row0ftsort.cc7
-rw-r--r--storage/innobase/srv/srv0srv.cc4
-rw-r--r--storage/xtradb/buf/buf0buf.cc25
-rw-r--r--storage/xtradb/os/os0file.cc4
-rw-r--r--storage/xtradb/row/row0ftsort.cc7
-rw-r--r--storage/xtradb/srv/srv0srv.cc4
8 files changed, 38 insertions, 42 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 589fd734ba3..89924dd3675 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -5788,23 +5788,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 %lu / 1000,"
- " young-making rate %lu / 1000 not %lu / 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));
+ "Buffer pool hit rate " ULINTPF " / 1000,"
+ " young-making rate " ULINTPF " / 1000 not "
+ ULINTPF " / 1000\n",
+ 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);
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 3a5c41868ba..d1ef91d72bb 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -5974,8 +5974,8 @@ os_aio_print(
os_n_file_writes,
os_n_fsyncs);
- const ulint n_reads = MONITOR_VALUE(MONITOR_OS_PENDING_READS);
- const ulint n_writes = MONITOR_VALUE(MONITOR_OS_PENDING_WRITES);
+ const ulint n_reads = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS));
+ const ulint n_writes = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_WRITES));
if (n_reads != 0 || n_writes != 0) {
fprintf(file,
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 0c1ff402f8f..d88c1ed2c66 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1317,10 +1317,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];
@@ -1389,7 +1388,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;
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 41e1aef5df9..e5f00b9f95f 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1480,10 +1480,10 @@ srv_export_innodb_status(void)
mutex_enter(&srv_innodb_monitor_mutex);
export_vars.innodb_data_pending_reads =
- MONITOR_VALUE(MONITOR_OS_PENDING_READS);
+ ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS));
export_vars.innodb_data_pending_writes =
- MONITOR_VALUE(MONITOR_OS_PENDING_WRITES);
+ ulint(MONITOR_VALUE(MONITOR_OS_PENDING_WRITES));
export_vars.innodb_data_pending_fsyncs =
fil_n_pending_log_flushes
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 5b448999cca..3fe07800fd3 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -5928,23 +5928,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 %lu / 1000,"
- " young-making rate %lu / 1000 not %lu / 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));
+ "Buffer pool hit rate " ULINTPF " / 1000,"
+ " young-making rate " ULINTPF " / 1000 not "
+ ULINTPF " / 1000\n",
+ 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);
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index 57308150a07..03200fee80b 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -6102,8 +6102,8 @@ os_aio_print(
os_n_file_writes,
os_n_fsyncs);
- const ulint n_reads = MONITOR_VALUE(MONITOR_OS_PENDING_READS);
- const ulint n_writes = MONITOR_VALUE(MONITOR_OS_PENDING_WRITES);
+ const ulint n_reads = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS));
+ const ulint n_writes = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_WRITES));
if (n_reads != 0 || n_writes != 0) {
fprintf(file,
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index 29ddffd2587..4542aa31a6c 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -1320,10 +1320,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];
@@ -1392,7 +1391,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;
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index 59091bbbfe5..59c780ffa47 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -1819,10 +1819,10 @@ srv_export_innodb_status(void)
mutex_enter(&srv_innodb_monitor_mutex);
export_vars.innodb_data_pending_reads =
- MONITOR_VALUE(MONITOR_OS_PENDING_READS);
+ ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS));
export_vars.innodb_data_pending_writes =
- MONITOR_VALUE(MONITOR_OS_PENDING_WRITES);
+ ulint(MONITOR_VALUE(MONITOR_OS_PENDING_WRITES));
export_vars.innodb_data_pending_fsyncs =
fil_n_pending_log_flushes