Commit c65c50ae authored by marko's avatar marko

branches/zip: Minor cleanup. Remove MLOG_ZIP_ROOT_RAISE.

btr_page_create(): Remove parameters "prev" and "next".  The pointers
to adjacent B-tree pages will be set in the caller before any user
records are inserted.

Remove the redo log entry type MLOG_ZIP_ROOT_RAISE, since
btr_root_raise_and_insert() will not defer modifications to
the compressed page.

btr_attach_half_pages(): Add parameter new_page_zip.
parent e20dfbc0
...@@ -249,8 +249,6 @@ btr_page_create( ...@@ -249,8 +249,6 @@ btr_page_create(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dict_tree_t* tree, /* in: index tree */ dict_tree_t* tree, /* in: index tree */
ulint level, /* in: the B-tree level of the page */ ulint level, /* in: the B-tree level of the page */
ulint prev, /* in: number of the previous page */
ulint next, /* in: number of the next page */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
dict_index_t* index = UT_LIST_GET_FIRST(tree->tree_indexes); dict_index_t* index = UT_LIST_GET_FIRST(tree->tree_indexes);
...@@ -266,10 +264,6 @@ btr_page_create( ...@@ -266,10 +264,6 @@ btr_page_create(
btr_page_set_level(page, NULL, level, mtr); btr_page_set_level(page, NULL, level, mtr);
} }
/* Set the next node and previous node fields of new page */
btr_page_set_next(page, page_zip, prev, mtr);
btr_page_set_prev(page, page_zip, next, mtr);
buf_block_align(page)->check_index_page_at_flush = TRUE; buf_block_align(page)->check_index_page_at_flush = TRUE;
btr_page_set_index_id(page, page_zip, tree->id, mtr); btr_page_set_index_id(page, page_zip, tree->id, mtr);
...@@ -1079,8 +1073,11 @@ btr_root_raise_and_insert( ...@@ -1079,8 +1073,11 @@ btr_root_raise_and_insert(
new_page = btr_page_alloc(tree, 0, FSP_NO_DIR, level, mtr); new_page = btr_page_alloc(tree, 0, FSP_NO_DIR, level, mtr);
new_page_zip = buf_block_get_page_zip(buf_block_align(new_page)); new_page_zip = buf_block_get_page_zip(buf_block_align(new_page));
btr_page_create(new_page, new_page_zip, tree, level, btr_page_create(new_page, new_page_zip, tree, level, mtr);
FIL_NULL, FIL_NULL, mtr);
/* Set the next node and previous node fields of new page */
btr_page_set_next(new_page, new_page_zip, FIL_NULL, mtr);
btr_page_set_prev(new_page, new_page_zip, FIL_NULL, mtr);
/* Move the records from root to the new page */ /* Move the records from root to the new page */
...@@ -1519,12 +1516,12 @@ btr_attach_half_pages( ...@@ -1519,12 +1516,12 @@ btr_attach_half_pages(
/*==================*/ /*==================*/
dict_tree_t* tree, /* in: the index tree */ dict_tree_t* tree, /* in: the index tree */
page_t* page, /* in/out: page to be split */ page_t* page, /* in/out: page to be split */
page_zip_des_t* page_zip, /* in/out: compressed page whose page_zip_des_t* page_zip, /* in/out: compressed page, or NULL */
uncompressed part will be updated,
or NULL */
rec_t* split_rec, /* in: first record on upper rec_t* split_rec, /* in: first record on upper
half page */ half page */
page_t* new_page, /* in: the new half page */ page_t* new_page, /* in/out: the new half page */
page_zip_des_t* new_page_zip, /* in/out: compressed new_page,
or NULL */
ulint direction, /* in: FSP_UP or FSP_DOWN */ ulint direction, /* in: FSP_UP or FSP_DOWN */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
...@@ -1560,8 +1557,7 @@ btr_attach_half_pages( ...@@ -1560,8 +1557,7 @@ btr_attach_half_pages(
upper_page_no = buf_frame_get_page_no(page); upper_page_no = buf_frame_get_page_no(page);
lower_page = new_page; lower_page = new_page;
upper_page = page; upper_page = page;
lower_page_zip = buf_block_get_page_zip( lower_page_zip = new_page_zip;
buf_block_align(new_page));
upper_page_zip = page_zip; upper_page_zip = page_zip;
/* Look from the tree for the node pointer to page */ /* Look from the tree for the node pointer to page */
...@@ -1583,8 +1579,7 @@ btr_attach_half_pages( ...@@ -1583,8 +1579,7 @@ btr_attach_half_pages(
lower_page = page; lower_page = page;
upper_page = new_page; upper_page = new_page;
lower_page_zip = page_zip; lower_page_zip = page_zip;
upper_page_zip = buf_block_get_page_zip( upper_page_zip = new_page_zip;
buf_block_align(new_page));
} }
/* Get the level of the split pages */ /* Get the level of the split pages */
...@@ -1737,7 +1732,7 @@ btr_page_split_and_insert( ...@@ -1737,7 +1732,7 @@ btr_page_split_and_insert(
btr_page_get_level(page, mtr), mtr); btr_page_get_level(page, mtr), mtr);
new_page_zip = buf_block_get_page_zip(buf_block_align(new_page)); new_page_zip = buf_block_get_page_zip(buf_block_align(new_page));
btr_page_create(new_page, new_page_zip, tree, btr_page_create(new_page, new_page_zip, tree,
btr_page_get_level(page, mtr), 0, 0, mtr); btr_page_get_level(page, mtr), mtr);
/* 3. Calculate the first record on the upper half-page, and the /* 3. Calculate the first record on the upper half-page, and the
first record (move_limit) on original page which ends up on the first record (move_limit) on original page which ends up on the
...@@ -1756,7 +1751,7 @@ btr_page_split_and_insert( ...@@ -1756,7 +1751,7 @@ btr_page_split_and_insert(
/* 4. Do first the modifications in the tree structure */ /* 4. Do first the modifications in the tree structure */
btr_attach_half_pages(tree, page, page_zip, first_rec, btr_attach_half_pages(tree, page, page_zip, first_rec,
new_page, direction, mtr); new_page, new_page_zip, direction, mtr);
/* If the split is made on the leaf level and the insert will fit /* If the split is made on the leaf level and the insert will fit
on the appropriate half-page, we may release the tree x-latch. on the appropriate half-page, we may release the tree x-latch.
......
...@@ -143,9 +143,7 @@ flag value must give the length also! */ ...@@ -143,9 +143,7 @@ flag value must give the length also! */
start to a compressed page */ start to a compressed page */
#define MLOG_ZIP_LIST_END_COPY ((byte)52) /* copy compact record list #define MLOG_ZIP_LIST_END_COPY ((byte)52) /* copy compact record list
end to a compressed page */ end to a compressed page */
#define MLOG_ZIP_ROOT_RAISE ((byte)53) /* raise the root of a #define MLOG_BIGGEST_TYPE ((byte)52) /* biggest value (used in
compressed B-tree */
#define MLOG_BIGGEST_TYPE ((byte)53) /* biggest value (used in
asserts) */ asserts) */
/******************************************************************* /*******************************************************************
......
...@@ -914,7 +914,6 @@ recv_parse_or_apply_log_rec_body( ...@@ -914,7 +914,6 @@ recv_parse_or_apply_log_rec_body(
break; break;
case MLOG_ZIP_LIST_START_COPY: case MLOG_ZIP_LIST_START_COPY:
case MLOG_ZIP_LIST_END_COPY: case MLOG_ZIP_LIST_END_COPY:
case MLOG_ZIP_ROOT_RAISE:
ut_error; /* TODO */ ut_error; /* TODO */
break; break;
default: default:
......
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