summaryrefslogtreecommitdiff
path: root/storage/innobase/btr
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/btr')
-rw-r--r--storage/innobase/btr/btr0btr.cc8
-rw-r--r--storage/innobase/btr/btr0cur.cc20
-rw-r--r--storage/innobase/btr/btr0defragment.cc6
-rw-r--r--storage/innobase/btr/btr0pcur.cc4
-rw-r--r--storage/innobase/btr/btr0scrub.cc21
-rw-r--r--storage/innobase/btr/btr0sea.cc7
6 files changed, 34 insertions, 32 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 4bebb9ee7dd..49ac63cff6d 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -2,7 +2,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2014, 2016, MariaDB Corporation
+Copyright (c) 2014, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -725,7 +725,7 @@ btr_page_free_low(
offsets = rec_get_offsets(rec, index,
offsets, ULINT_UNDEFINED,
&heap);
- uint size = rec_offs_data_size(offsets);
+ ulint size = rec_offs_data_size(offsets);
memset(rec, 0, size);
rec = page_rec_get_next(rec);
cnt++;
@@ -890,7 +890,7 @@ btr_page_get_father_node_ptr_func(
ulint latch_mode,/*!< in: BTR_CONT_MODIFY_TREE
or BTR_CONT_SEARCH_TREE */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
dtuple_t* tuple;
@@ -2396,7 +2396,7 @@ btr_insert_on_non_leaf_level_func(
ulint level, /*!< in: level, must be > 0 */
dtuple_t* tuple, /*!< in: the record to be inserted */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
big_rec_t* dummy_big_rec;
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 0abc930c11d..06b5b66c2aa 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -148,7 +148,7 @@ can be released by page reorganize, then it is reorganized */
@param not_empty table not empty
@return estimated table wide stats from sampled value */
#define BTR_TABLE_STATS_FROM_SAMPLE(value, index, sample, ext_size, not_empty) \
- (((value) * static_cast<int64_t>(index->stat_n_leaf_pages) \
+ (((value) * static_cast<ib_uint64_t>(index->stat_n_leaf_pages) \
+ (sample) - 1 + (ext_size) + (not_empty)) / ((sample) + (ext_size)))
/* @} */
@@ -414,7 +414,7 @@ btr_cur_optimistic_latch_leaves(
ulint* latch_mode,
btr_cur_t* cursor,
const char* file,
- ulint line,
+ unsigned line,
mtr_t* mtr)
{
ulint mode;
@@ -747,7 +747,7 @@ btr_cur_search_to_nth_level(
caller currently has on search system:
RW_S_LATCH, or 0 */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr, /*!< in: mtr */
ib_uint64_t autoinc)/*!< in: PAGE_ROOT_AUTO_INC to be written
(0 if none) */
@@ -2042,7 +2042,7 @@ btr_cur_open_at_index_side_func(
ulint level, /*!< in: level to search for
(0=leaf). */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
page_cur_t* page_cursor;
@@ -2414,7 +2414,7 @@ btr_cur_open_at_rnd_pos_func(
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
btr_cur_t* cursor, /*!< in/out: B-tree cursor */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
page_cur_t* page_cursor;
@@ -3623,7 +3623,7 @@ btr_cur_update_in_place(
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|| dict_index_is_clust(index));
ut_ad(thr_get_trx(thr)->id == trx_id
- || (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))
+ || (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)))
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
ut_ad(fil_page_index_page_check(btr_cur_get_page(cursor)));
@@ -3790,7 +3790,7 @@ btr_cur_optimistic_update(
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|| dict_index_is_clust(index));
ut_ad(thr_get_trx(thr)->id == trx_id
- || (flags & ~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP))
+ || (flags & ulint(~(BTR_KEEP_POS_FLAG | BTR_KEEP_IBUF_BITMAP)))
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
ut_ad(fil_page_index_page_check(page));
@@ -4123,7 +4123,7 @@ btr_cur_pessimistic_update(
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|| dict_index_is_clust(index));
ut_ad(thr_get_trx(thr)->id == trx_id
- || (flags & ~BTR_KEEP_POS_FLAG)
+ || (flags & ulint(~BTR_KEEP_POS_FLAG))
== (BTR_NO_UNDO_LOG_FLAG | BTR_NO_LOCKING_FLAG
| BTR_CREATE_FLAG | BTR_KEEP_SYS_FLAG));
@@ -6231,12 +6231,12 @@ btr_cur_set_ownership_of_extern_field(
byte_val = mach_read_from_1(data + local_len + BTR_EXTERN_LEN);
if (val) {
- byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG);
+ byte_val &= ~BTR_EXTERN_OWNER_FLAG;
} else {
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
ut_a(!(byte_val & BTR_EXTERN_OWNER_FLAG));
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
- byte_val = byte_val | BTR_EXTERN_OWNER_FLAG;
+ byte_val |= BTR_EXTERN_OWNER_FLAG;
}
if (page_zip) {
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 7f06aed9ff0..8c4f27cc78a 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved.
-Copyright (C) 2014, 2016, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2014, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -696,8 +696,8 @@ btr_defragment_n_pages(
(data_size_per_rec
* srv_defragment_fill_factor_n_recs));
optimal_page_size -= reserved_space;
- n_new_slots = (total_data_size + optimal_page_size - 1)
- / optimal_page_size;
+ n_new_slots = uint((total_data_size + optimal_page_size - 1)
+ / optimal_page_size);
if (n_new_slots >= n_pages) {
/* Can't defragment. */
if (end_of_index)
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index ecf3f7c07cb..741f16e0df4 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -229,7 +229,7 @@ btr_pcur_restore_position_func(
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ... */
btr_pcur_t* cursor, /*!< in: detached persistent cursor */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
dict_index_t* index;
@@ -586,7 +586,7 @@ btr_pcur_open_on_user_rec_func(
btr_pcur_t* cursor, /*!< in: memory buffer for persistent
cursor */
const char* file, /*!< in: file name */
- ulint line, /*!< in: line where called */
+ unsigned line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
btr_pcur_open_low(index, 0, tuple, mode, latch_mode, cursor,
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 8051c517e3a..e2670521cf3 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -254,11 +254,10 @@ btr_page_needs_scrubbing(
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
}
- page_t* page = buf_block_get_frame(block);
- uint type = fil_page_get_type(page);
+ const page_t* page = buf_block_get_frame(block);
if (allocated == BTR_SCRUB_PAGE_ALLOCATED) {
- if (type != FIL_PAGE_INDEX) {
+ if (fil_page_get_type(page) != FIL_PAGE_INDEX) {
/* this function is called from fil-crypt-threads.
* these threads iterate all pages of all tablespaces
* and don't know about fil_page_type.
@@ -275,7 +274,7 @@ btr_page_needs_scrubbing(
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
}
- if (page_has_garbage(page) == false) {
+ if (!page_has_garbage(page)) {
/* no garbage (from deleted/shrunken records) */
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
}
@@ -283,11 +282,12 @@ btr_page_needs_scrubbing(
} else if (allocated == BTR_SCRUB_PAGE_FREE ||
allocated == BTR_SCRUB_PAGE_ALLOCATION_UNKNOWN) {
- if (! (type == FIL_PAGE_INDEX ||
- type == FIL_PAGE_TYPE_BLOB ||
- type == FIL_PAGE_TYPE_ZBLOB ||
- type == FIL_PAGE_TYPE_ZBLOB2)) {
-
+ switch (fil_page_get_type(page)) {
+ case FIL_PAGE_INDEX:
+ case FIL_PAGE_TYPE_ZBLOB:
+ case FIL_PAGE_TYPE_ZBLOB2:
+ break;
+ default:
/**
* If this is a dropped page, we also need to scrub
* BLOB pages
@@ -299,7 +299,8 @@ btr_page_needs_scrubbing(
}
}
- if (btr_page_get_index_id(page) == IBUF_INDEX_ID) {
+ if (block->page.id.space() == TRX_SYS_SPACE
+ && btr_page_get_index_id(page) == IBUF_INDEX_ID) {
/* skip ibuf */
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
}
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index d777e2abc4d..86827fabdd4 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -2,6 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
+Copyright (c) 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1547,9 +1548,9 @@ btr_search_build_page_hash_index(
block->n_hash_helps = 0;
- block->curr_n_fields = n_fields;
- block->curr_n_bytes = n_bytes;
- block->curr_left_side = left_side;
+ block->curr_n_fields = unsigned(n_fields);
+ block->curr_n_bytes = unsigned(n_bytes);
+ block->curr_left_side = unsigned(left_side);
block->index = index;
for (i = 0; i < n_cached; i++) {