Commit 05c33d6d authored by marko's avatar marko

branches/zip: When invoking page_zip_copy_recs(), update the lock table

and the adaptive hash index.  This should fix Issue #95 and Issue #87.

page_zip_copy_recs(): Copy PAGE_MAX_TRX_ID as well, to have similar behavior
to page_copy_rec_list_start() and page_copy_rec_list_end().

btr_root_raise_and_insert(), btr_page_split_and_insert(), btr_lift_page_up():
Update the lock table and the adaptive hash index.
parent 344481d5
......@@ -1186,6 +1186,14 @@ btr_root_raise_and_insert(
/* Copy the page byte for byte. */
page_zip_copy_recs(new_page_zip, new_page,
root_page_zip, root, index, mtr);
/* Update the lock table and possible hash index. */
lock_move_rec_list_end(new_block, root_block,
page_get_infimum_rec(root));
btr_search_move_or_delete_hash_entries(new_block, root_block,
index);
}
/* If this is a pessimistic insert which is actually done to
......@@ -1955,6 +1963,18 @@ insert_right:
new_block, cursor->index,
ULINT_UNDEFINED,
ULINT_UNDEFINED, mtr);
/* Update the lock table and possible hash index. */
lock_move_rec_list_start(
new_block, block, move_limit,
new_page + PAGE_NEW_INFIMUM);
btr_search_move_or_delete_hash_entries(
new_block, block, cursor->index);
/* Delete the records from the source page. */
page_delete_rec_list_start(move_limit, block,
cursor->index, mtr);
}
......@@ -1981,6 +2001,16 @@ insert_right:
page_delete_rec_list_start(move_limit - page
+ new_page, new_block,
cursor->index, mtr);
/* Update the lock table and possible hash index. */
lock_move_rec_list_end(new_block, block, move_limit);
btr_search_move_or_delete_hash_entries(
new_block, block, cursor->index);
/* Delete the records from the source page. */
page_delete_rec_list_end(move_limit, block,
cursor->index,
ULINT_UNDEFINED,
......@@ -2341,6 +2371,14 @@ btr_lift_page_up(
/* Copy the page byte for byte. */
page_zip_copy_recs(father_page_zip, father_page,
page_zip, page, index, mtr);
/* Update the lock table and possible hash index. */
lock_move_rec_list_end(father_block, block,
page_get_infimum_rec(page));
btr_search_move_or_delete_hash_entries(father_block, block,
index);
}
lock_update_copy_and_discard(father_block, block);
......
......@@ -387,7 +387,8 @@ page_zip_reorganize(
/**************************************************************************
Copy the records of a page byte for byte. Do not copy the page header
or trailer, except those B-tree header fields that are directly
related to the storage of records. */
related to the storage of records. Also copy PAGE_MAX_TRX_ID.
NOTE: The caller must update the lock table and the adaptive hash index. */
UNIV_INTERN
void
page_zip_copy_recs(
......
......@@ -4387,7 +4387,8 @@ page_zip_reorganize(
/**************************************************************************
Copy the records of a page byte for byte. Do not copy the page header
or trailer, except those B-tree header fields that are directly
related to the storage of records. */
related to the storage of records. Also copy PAGE_MAX_TRX_ID.
NOTE: The caller must update the lock table and the adaptive hash index. */
UNIV_INTERN
void
page_zip_copy_recs(
......@@ -4422,18 +4423,18 @@ page_zip_copy_recs(
UNIV_MEM_ASSERT_RW(src_zip->data, page_zip_get_size(page_zip));
/* Copy those B-tree page header fields that are related to
the records stored in the page. Do not copy the field
the records stored in the page. Also copy the field
PAGE_MAX_TRX_ID. Skip the rest of the page header and
trailer. On the compressed page, there is no trailer. */
#if PAGE_MAX_TRX_ID + 8 != PAGE_HEADER_PRIV_END
# error "PAGE_MAX_TRX_ID + 8 != PAGE_HEADER_PRIV_END"
#endif
memcpy(PAGE_HEADER + page, PAGE_HEADER + src,
PAGE_MAX_TRX_ID);
PAGE_HEADER_PRIV_END);
memcpy(PAGE_DATA + page, PAGE_DATA + src,
UNIV_PAGE_SIZE - PAGE_DATA - FIL_PAGE_DATA_END);
memcpy(PAGE_HEADER + page_zip->data, PAGE_HEADER + src_zip->data,
PAGE_MAX_TRX_ID);
PAGE_HEADER_PRIV_END);
memcpy(PAGE_DATA + page_zip->data, PAGE_DATA + src_zip->data,
page_zip_get_size(page_zip) - PAGE_DATA);
......
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