Commit fc249aa5 authored by marko's avatar marko

branches/zip: Do not update the free bits in the insert buffer bitmap

when inserting or deleting from the insert buffer B-tree.  Assert that
records in the insert buffer B-tree are never updated.  This could cure
Issue #135.

btr_cur_optimistic_insert(): Do not update the insert buffer bitmap
when inserting to the insert buffer tree.

btr_cur_optimistic_delete(): Do not update the insert buffer bitmap
when deleting from the insert buffer tree.  This could be the cause
of the assertion failure that was reported in Issue #135.

btr_cur_update_alloc_zip(): Assert that the index is not the insert
buffer.  The insert buffer will never be stored in compressed format.

btr_cur_update_in_place(), btr_cur_optimistic_update(),
btr_cur_pessimistic_update(): Assert that these functions are never
invoked on the insert buffer tree.  The insert buffer only supports
the insertion and deletion of records.
parent ba654320
......@@ -1217,7 +1217,9 @@ btr_cur_optimistic_insert(
buf_block_get_page_no(block), max_size,
rec_size + PAGE_DIR_SLOT_SIZE, index->type);
#endif
if (!dict_index_is_clust(index) && leaf) {
if (leaf
&& !dict_index_is_clust(index)
&& !dict_index_is_ibuf(index)) {
/* Update the free bits of the B-tree page in the
insert buffer bitmap. */
......@@ -1598,6 +1600,7 @@ btr_cur_update_alloc_zip(
{
ut_a(page_zip == buf_block_get_page_zip(block));
ut_ad(page_zip);
ut_ad(!dict_index_is_ibuf(index));
if (page_zip_available(page_zip, dict_index_is_clust(index),
length, 0)) {
......@@ -1674,6 +1677,9 @@ btr_cur_update_in_place(
rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
trx = thr_get_trx(thr);
offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
#ifdef UNIV_DEBUG
......@@ -1810,6 +1816,8 @@ btr_cur_optimistic_update(
index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
heap = mem_heap_create(1024);
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
......@@ -2073,6 +2081,8 @@ btr_cur_pessimistic_update(
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
optim_err = btr_cur_optimistic_update(flags, cursor, update,
cmpl_info, thr, mtr);
......@@ -2775,10 +2785,12 @@ btr_cur_optimistic_delete(
#endif /* UNIV_ZIP_DEBUG */
if (dict_index_is_clust(cursor->index)
|| dict_index_is_ibuf(cursor->index)
|| !page_is_leaf(page)) {
/* The insert buffer does not handle
inserts to clustered indexes or to non-leaf
pages of secondary index B-trees. */
inserts to clustered indexes, to
non-leaf pages of secondary index B-trees,
or to the insert buffer. */
} else if (page_zip) {
ibuf_update_free_bits_zip(block, mtr);
} else {
......
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