mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
branches/zip: Fix bugs.
btr_root_raise_and_insert(): When copying root to new_page byte for byte, restore the page number of new_page afterwards. buf_flush_init_for_writing(): For FIL_PAGE_INDEX, write the page number and space id also to the uncompressed page.
This commit is contained in:
parent
6bde840828
commit
8f167973c2
2 changed files with 15 additions and 2 deletions
|
@ -1088,11 +1088,19 @@ btr_root_raise_and_insert(
|
|||
if (UNIV_UNLIKELY(!page_copy_rec_list_end(new_page, new_page_zip,
|
||||
page_get_infimum_rec(root), cursor->index, mtr))) {
|
||||
ut_a(new_page_zip);
|
||||
byte page_no[4];
|
||||
|
||||
/* Copy the pages byte for byte and restore the page offset.
|
||||
This cannot fail, because the compressed page
|
||||
will be modified in place. */
|
||||
memcpy(page_no, new_page + FIL_PAGE_OFFSET, 4);
|
||||
memcpy(new_page, root, UNIV_PAGE_SIZE);
|
||||
memcpy(new_page + FIL_PAGE_OFFSET, page_no, 4);
|
||||
|
||||
/* Copy the pages byte for byte. This will succeed. */
|
||||
buf_frame_copy(new_page, root);
|
||||
memcpy(new_page_zip->data, root_page_zip->data,
|
||||
new_page_zip->size);
|
||||
memcpy(new_page_zip->data + FIL_PAGE_OFFSET, page_no, 4);
|
||||
|
||||
new_page_zip->n_blobs = 0;
|
||||
new_page_zip->m_start = root_page_zip->m_start;
|
||||
new_page_zip->m_end = root_page_zip->m_end;
|
||||
|
|
|
@ -477,6 +477,11 @@ buf_flush_init_for_writing(
|
|||
break;
|
||||
case FIL_PAGE_INDEX:
|
||||
ut_a(zip_size == page_zip->size);
|
||||
mach_write_to_4(page
|
||||
+ FIL_PAGE_OFFSET, page_no);
|
||||
mach_write_to_4(page
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||
space);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_OFFSET, page_no);
|
||||
mach_write_to_8(page_zip->data
|
||||
|
|
Loading…
Reference in a new issue