Commit adab0b86 authored by marko's avatar marko

branches/zip: Assert in the adaptive hash that the insert buffer B-tree

is not indexed.

btr_search_update_hash_ref(), btr_search_drop_page_hash_index(),
btr_search_build_page_hash_index(), btr_search_update_hash_on_delete(),
btr_search_update_hash_node_on_insert(), btr_search_update_hash_on_insert(),
btr_search_validate():
Assert that hashed blocks do not belong to the insert buffer tree.

btr_search_move_or_delete_hash_entries():
When invoked on the insert buffer tree, assert that neither block is hashed.
parent 64c95da8
......@@ -438,10 +438,16 @@ btr_search_update_hash_ref(
#endif /* UNIV_SYNC_DEBUG */
ut_ad(page_align(btr_cur_get_rec(cursor))
== buf_block_get_frame(block));
ut_a(!block->is_hashed || block->index == cursor->index);
if (block->is_hashed
&& (info->n_hash_potential > 0)
if (!block->is_hashed) {
return;
}
ut_a(block->index == cursor->index);
ut_a(!dict_index_is_ibuf(cursor->index));
if ((info->n_hash_potential > 0)
&& (block->curr_n_fields == info->n_fields)
&& (block->curr_n_bytes == info->n_bytes)
&& (block->curr_left_side == info->left_side)) {
......@@ -981,6 +987,7 @@ retry:
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
index = block->index;
ut_a(!dict_index_is_ibuf(index));
/* NOTE: The fields of block must not be accessed after
releasing btr_search_latch, as the index page might only
......@@ -1163,6 +1170,7 @@ btr_search_build_page_hash_index(
rec_offs_init(offsets_);
ut_ad(index);
ut_a(!dict_index_is_ibuf(index));
table = btr_search_sys->hash_index;
page = buf_block_get_frame(block);
......@@ -1337,6 +1345,8 @@ btr_search_move_or_delete_hash_entries(
#endif /* UNIV_SYNC_DEBUG */
ut_a(!new_block->is_hashed || new_block->index == index);
ut_a(!block->is_hashed || block->index == index);
ut_a(!(new_block->is_hashed || block->is_hashed)
|| !dict_index_is_ibuf(index));
rw_lock_s_lock(&btr_search_latch);
......@@ -1409,6 +1419,7 @@ btr_search_update_hash_on_delete(
ut_a(block->index == cursor->index);
ut_a(block->curr_n_fields + block->curr_n_bytes > 0);
ut_a(!dict_index_is_ibuf(cursor->index));
table = btr_search_sys->hash_index;
......@@ -1455,6 +1466,7 @@ btr_search_update_hash_node_on_insert(
}
ut_a(block->index == cursor->index);
ut_a(!dict_index_is_ibuf(cursor->index));
rw_lock_x_lock(&btr_search_latch);
......@@ -1523,6 +1535,7 @@ btr_search_update_hash_on_insert(
}
ut_a(block->index == cursor->index);
ut_a(!dict_index_is_ibuf(cursor->index));
index_id = cursor->index->id;
......@@ -1692,6 +1705,8 @@ btr_search_validate(void)
continue;
}
ut_a(!dict_index_is_ibuf(block->index));
offsets = rec_get_offsets((const rec_t*) node->data,
block->index, offsets,
block->curr_n_fields
......
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