summaryrefslogtreecommitdiff
path: root/storage/innobase/btr/btr0scrub.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/btr/btr0scrub.cc')
-rw-r--r--storage/innobase/btr/btr0scrub.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 8ed0117b36e..f361a9d8b1e 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -366,12 +366,17 @@ btr_optimistic_scrub(
/* We play safe and reset the free bits */
if (!dict_index_is_clust(index) &&
- page_is_leaf(buf_block_get_frame(block))) {
+ block != NULL) {
+ buf_frame_t* frame = buf_block_get_frame(block);
+ if (frame &&
+ page_is_leaf(frame)) {
ibuf_reset_free_bits(block);
+ }
}
scrub_data->scrub_stat.page_reorganizations++;
+
return DB_SUCCESS;
}
@@ -486,9 +491,13 @@ btr_pessimistic_scrub(
/* We play safe and reset the free bits
* NOTE: need to call this prior to btr_page_split_and_insert */
if (!dict_index_is_clust(index) &&
- page_is_leaf(buf_block_get_frame(block))) {
+ block != NULL) {
+ buf_frame_t* frame = buf_block_get_frame(block);
+ if (frame &&
+ page_is_leaf(frame)) {
- ibuf_reset_free_bits(block);
+ ibuf_reset_free_bits(block);
+ }
}
rec = btr_page_split_and_insert(
@@ -787,11 +796,8 @@ btr_scrub_page(
return BTR_SCRUB_SKIP_PAGE_AND_CLOSE_TABLE;
}
- buf_frame_t* frame = NULL;
+ buf_frame_t* frame = buf_block_get_frame(block);
- if (block) {
- frame = buf_block_get_frame(block);
- }
if (!frame || btr_page_get_index_id(frame) !=
scrub_data->current_index->id) {
/* page has been reallocated to new index */