mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
branches/zip: Remove some more buf_block_align() calls.
Replace buf_frame_modify_clock_inc() with buf_block_modify_clock_inc(). Replace buf_frame_get_lock_hash_val() with buf_block_get_lock_hash_val(). Replace buf_frame_get_lock_mutex() with buf_block_get_lock_mutex(). page_create_zip(), page_create(), page_create_low(), btr_page_free(), btr_page_free_low(): Replace page_t with buf_block_t.
This commit is contained in:
parent
47e6669d94
commit
e5b6c39477
11 changed files with 112 additions and 156 deletions
|
@ -235,14 +235,14 @@ btr_page_create(
|
|||
ulint level, /* in: the B-tree level of the page */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page = buf_block_get_frame(block);
|
||||
page_t* page = buf_block_get_frame(block);
|
||||
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||
page_create_zip(page, page_zip, index, level, mtr);
|
||||
page_create_zip(block, index, level, mtr);
|
||||
} else {
|
||||
page_create(page, mtr, dict_table_is_comp(index->table));
|
||||
page_create(block, mtr, dict_table_is_comp(index->table));
|
||||
/* Set the level of the new index page */
|
||||
btr_page_set_level(page, NULL, level, mtr);
|
||||
}
|
||||
|
@ -397,16 +397,17 @@ void
|
|||
btr_page_free_for_ibuf(
|
||||
/*===================*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
buf_block_t* block, /* in: block to be freed, x-latched */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* root;
|
||||
|
||||
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
root = btr_root_get(index, mtr);
|
||||
|
||||
flst_add_first(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
|
||||
page + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE, mtr);
|
||||
buf_block_get_frame(block)
|
||||
+ PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE, mtr);
|
||||
|
||||
ut_ad(flst_validate(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
|
||||
mtr));
|
||||
|
@ -421,24 +422,22 @@ void
|
|||
btr_page_free_low(
|
||||
/*==============*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
ulint space, /* in: space */
|
||||
ulint page_no,/* in: page number */
|
||||
buf_block_t* block, /* in: block to be freed, x-latched */
|
||||
ulint level, /* in: page level */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
fseg_header_t* seg_header;
|
||||
page_t* root;
|
||||
|
||||
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
/* The page gets invalid for optimistic searches: increment the frame
|
||||
modify clock */
|
||||
|
||||
buf_frame_modify_clock_inc(page);
|
||||
buf_block_modify_clock_inc(block);
|
||||
|
||||
if (index->type & DICT_IBUF) {
|
||||
|
||||
btr_page_free_for_ibuf(index, page, mtr);
|
||||
btr_page_free_for_ibuf(index, block, mtr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -451,7 +450,9 @@ btr_page_free_low(
|
|||
seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_TOP;
|
||||
}
|
||||
|
||||
fseg_free_page(seg_header, space, page_no, mtr);
|
||||
fseg_free_page(seg_header,
|
||||
buf_block_get_space(block),
|
||||
buf_block_get_page_no(block), mtr);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
|
@ -462,20 +463,14 @@ void
|
|||
btr_page_free(
|
||||
/*==========*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
buf_block_t* block, /* in: block to be freed, x-latched */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint level;
|
||||
ulint space;
|
||||
ulint page_no;
|
||||
|
||||
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
|
||||
level = btr_page_get_level(page, mtr);
|
||||
level = btr_page_get_level(buf_block_get_frame(block), mtr);
|
||||
|
||||
space = page_get_space_id(page);
|
||||
page_no = page_get_page_no(page);
|
||||
|
||||
btr_page_free_low(index, page, space, page_no, level, mtr);
|
||||
btr_page_free_low(index, block, level, mtr);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
|
@ -726,9 +721,9 @@ btr_create(
|
|||
page_zip = buf_block_get_page_zip(block);
|
||||
|
||||
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||
page = page_create_zip(frame, page_zip, index, 0, mtr);
|
||||
page = page_create_zip(block, index, 0, mtr);
|
||||
} else {
|
||||
page = page_create(frame, mtr,
|
||||
page = page_create(block, mtr,
|
||||
dict_table_is_comp(index->table));
|
||||
/* Set the level of the new index page */
|
||||
btr_page_set_level(page, NULL, 0, mtr);
|
||||
|
@ -882,7 +877,7 @@ btr_page_reorganize_low(
|
|||
/* Recreate the page: note that global data on page (possible
|
||||
segment headers, next page-field, etc.) is preserved intact */
|
||||
|
||||
page_create(page, mtr, dict_table_is_comp(index->table));
|
||||
page_create(block, mtr, dict_table_is_comp(index->table));
|
||||
block->check_index_page_at_flush = TRUE;
|
||||
|
||||
/* Copy the records from the temporary space to the recreated page;
|
||||
|
@ -1008,10 +1003,10 @@ btr_page_empty(
|
|||
segment headers, next page-field, etc.) is preserved intact */
|
||||
|
||||
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||
page_create_zip(page, page_zip, index,
|
||||
page_create_zip(block, index,
|
||||
btr_page_get_level(page, mtr), mtr);
|
||||
} else {
|
||||
page_create(page, mtr, dict_table_is_comp(index->table));
|
||||
page_create(block, mtr, dict_table_is_comp(index->table));
|
||||
}
|
||||
|
||||
block->check_index_page_at_flush = TRUE;
|
||||
|
@ -1124,10 +1119,9 @@ btr_root_raise_and_insert(
|
|||
|
||||
/* Rebuild the root page to get free space */
|
||||
if (UNIV_LIKELY_NULL(root_page_zip)) {
|
||||
page_create_zip(root, root_page_zip, index,
|
||||
level + 1, mtr);
|
||||
page_create_zip(root_block, index, level + 1, mtr);
|
||||
} else {
|
||||
page_create(root, mtr, dict_table_is_comp(index->table));
|
||||
page_create(root_block, mtr, dict_table_is_comp(index->table));
|
||||
btr_page_set_level(root, NULL, level + 1, mtr);
|
||||
}
|
||||
|
||||
|
@ -2136,7 +2130,7 @@ void
|
|||
btr_lift_page_up(
|
||||
/*=============*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page which is the only on its level;
|
||||
buf_block_t* block, /* in: page which is the only on its level;
|
||||
must not be empty: use
|
||||
btr_discard_only_page_on_level if the last
|
||||
record from the page should be removed */
|
||||
|
@ -2146,7 +2140,7 @@ btr_lift_page_up(
|
|||
page_t* father_page;
|
||||
ulint page_level;
|
||||
page_zip_des_t* father_page_zip;
|
||||
buf_block_t* block = buf_block_align(page);
|
||||
page_t* page = buf_block_get_frame(block);
|
||||
|
||||
ut_ad(btr_page_get_prev(page, mtr) == FIL_NULL);
|
||||
ut_ad(btr_page_get_next(page, mtr) == FIL_NULL);
|
||||
|
@ -2187,7 +2181,7 @@ btr_lift_page_up(
|
|||
lock_update_copy_and_discard(father_page, page);
|
||||
|
||||
/* Free the file page */
|
||||
btr_page_free(index, page, mtr);
|
||||
btr_page_free(index, block, mtr);
|
||||
|
||||
/* We play safe and reset the free bits for the father */
|
||||
ibuf_reset_free_bits_with_type(index->type, father_block);
|
||||
|
@ -2223,6 +2217,7 @@ btr_compress(
|
|||
page_t* merge_page;
|
||||
page_zip_des_t* merge_page_zip;
|
||||
ibool is_left;
|
||||
buf_block_t* block;
|
||||
page_t* page;
|
||||
rec_t* node_ptr;
|
||||
ulint data_size;
|
||||
|
@ -2231,7 +2226,8 @@ btr_compress(
|
|||
ulint max_ins_size_reorg;
|
||||
ulint level;
|
||||
|
||||
page = btr_cur_get_page(cursor);
|
||||
block = buf_block_align(btr_cur_get_rec(cursor));
|
||||
page = buf_block_get_frame(block);
|
||||
index = btr_cur_get_index(cursor);
|
||||
ut_a((ibool) !!page_is_comp(page) == dict_table_is_comp(index->table));
|
||||
|
||||
|
@ -2280,7 +2276,7 @@ btr_compress(
|
|||
} else {
|
||||
/* The page is the only one on the level, lift the records
|
||||
to the father */
|
||||
btr_lift_page_up(index, page, mtr);
|
||||
btr_lift_page_up(index, block, mtr);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
@ -2428,7 +2424,7 @@ btr_compress(
|
|||
ut_ad(page_validate(merge_page, index));
|
||||
|
||||
/* Free the file page */
|
||||
btr_page_free(index, page, mtr);
|
||||
btr_page_free(index, block, mtr);
|
||||
|
||||
ut_ad(btr_check_node_ptr(index, merge_page, mtr));
|
||||
return(TRUE);
|
||||
|
@ -2466,7 +2462,7 @@ btr_discard_only_page_on_level(
|
|||
page_level, mtr);
|
||||
|
||||
/* Free the file page */
|
||||
btr_page_free(index, page, mtr);
|
||||
btr_page_free(index, block, mtr);
|
||||
|
||||
if (UNIV_LIKELY(page_get_page_no(father_page)
|
||||
== dict_index_get_page(index))) {
|
||||
|
@ -2582,7 +2578,7 @@ btr_discard_page(
|
|||
}
|
||||
|
||||
/* Free the file page */
|
||||
btr_page_free(index, page, mtr);
|
||||
btr_page_free(index, block, mtr);
|
||||
|
||||
ut_ad(btr_check_node_ptr(index, merge_page, mtr));
|
||||
}
|
||||
|
|
|
@ -1329,10 +1329,10 @@ btr_cur_pessimistic_insert(
|
|||
> free_space_zip)) {
|
||||
/* Try to insert the record by itself on a new page.
|
||||
If it fails, no amount of splitting will help. */
|
||||
buf_block_t* temp_block = buf_block_alloc(zip_size);
|
||||
page_t* temp_page = page_create_zip(
|
||||
temp_block->frame, &temp_block->page_zip,
|
||||
index, 0, NULL);
|
||||
buf_block_t* temp_block
|
||||
= buf_block_alloc(zip_size);
|
||||
page_t* temp_page
|
||||
= page_create_zip(temp_block, index, 0, NULL);
|
||||
page_cur_t temp_cursor;
|
||||
rec_t* temp_rec;
|
||||
|
||||
|
@ -3977,8 +3977,7 @@ btr_free_externally_stored_field(
|
|||
in row_purge_upd_exist_or_extern(). */
|
||||
next_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
|
||||
|
||||
btr_page_free_low(index, page,
|
||||
space_id, page_no, 0, &mtr);
|
||||
btr_page_free_low(index, ext_block, 0, &mtr);
|
||||
|
||||
if (UNIV_LIKELY(page_zip != NULL)) {
|
||||
mach_write_to_4(field_ref + BTR_EXTERN_PAGE_NO,
|
||||
|
@ -4016,8 +4015,7 @@ btr_free_externally_stored_field(
|
|||
ut_a(space_id == page_get_space_id(page));
|
||||
ut_a(page_no == page_get_page_no(page));
|
||||
|
||||
btr_page_free_low(index, page,
|
||||
space_id, page_no, 0, &mtr);
|
||||
btr_page_free_low(index, ext_block, 0, &mtr);
|
||||
|
||||
mlog_write_ulint(field_ref + BTR_EXTERN_PAGE_NO,
|
||||
next_page_no,
|
||||
|
|
|
@ -393,7 +393,7 @@ void
|
|||
btr_page_free(
|
||||
/*==========*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
buf_block_t* block, /* in: block to be freed, x-latched */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Frees a file page used in an index tree. Can be used also to BLOB
|
||||
|
@ -404,9 +404,7 @@ void
|
|||
btr_page_free_low(
|
||||
/*==============*/
|
||||
dict_index_t* index, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
ulint space, /* in: space */
|
||||
ulint page_no,/* in: page number */
|
||||
buf_block_t* block, /* in: block to be freed, x-latched */
|
||||
ulint level, /* in: page level */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
#ifdef UNIV_BTR_PRINT
|
||||
|
|
|
@ -371,23 +371,12 @@ buf_block_get_newest_modification(
|
|||
buf_block_t* block); /* in: block containing the page frame */
|
||||
/************************************************************************
|
||||
Increments the modify clock of a frame by 1. The caller must (1) own the
|
||||
pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_frame_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_frame_t* frame); /* in: pointer to a frame */
|
||||
/************************************************************************
|
||||
Increments the modify clock of a frame by 1. The caller must (1) own the
|
||||
buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
void
|
||||
buf_block_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_block_t* block); /* in: block */
|
||||
/************************************************************************
|
||||
Returns the value of the modify clock. The caller must have an s-lock
|
||||
|
@ -442,23 +431,25 @@ buf_ptr_get_fsp_addr(
|
|||
ulint* space, /* out: space id */
|
||||
fil_addr_t* addr); /* out: page offset and byte offset */
|
||||
/**************************************************************************
|
||||
Gets the hash value of the page the pointer is pointing to. This can be used
|
||||
in searches in the lock hash table. */
|
||||
Gets the hash value of a block. This can be used in searches in the
|
||||
lock hash table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_frame_get_lock_hash_val(
|
||||
buf_block_get_lock_hash_val(
|
||||
/*========================*/
|
||||
/* out: lock hash value */
|
||||
byte* ptr); /* in: pointer to within a buffer frame */
|
||||
/* out: lock hash value */
|
||||
const buf_block_t* block) /* in: block */
|
||||
__attribute__((const));
|
||||
/**************************************************************************
|
||||
Gets the mutex number protecting the page record lock hash chain in the lock
|
||||
table. */
|
||||
UNIV_INLINE
|
||||
mutex_t*
|
||||
buf_frame_get_lock_mutex(
|
||||
buf_block_get_lock_mutex(
|
||||
/*=====================*/
|
||||
/* out: mutex */
|
||||
byte* ptr); /* in: pointer to within a buffer frame */
|
||||
/* out: mutex */
|
||||
buf_block_t* block) /* in: block */
|
||||
__attribute__((const));
|
||||
/***********************************************************************
|
||||
Checks if a pointer points to the block array of the buffer pool (blocks, not
|
||||
the frames). */
|
||||
|
|
|
@ -299,15 +299,11 @@ Gets the hash value of the page the pointer is pointing to. This can be used
|
|||
in searches in the lock hash table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_frame_get_lock_hash_val(
|
||||
buf_block_get_lock_hash_val(
|
||||
/*========================*/
|
||||
/* out: lock hash value */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
/* out: lock hash value */
|
||||
const buf_block_t* block) /* in: block */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_block_align(ptr);
|
||||
|
||||
return(block->lock_hash_val);
|
||||
}
|
||||
|
||||
|
@ -318,13 +314,9 @@ UNIV_INLINE
|
|||
mutex_t*
|
||||
buf_frame_get_lock_mutex(
|
||||
/*=====================*/
|
||||
/* out: mutex */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
/* out: mutex */
|
||||
buf_block_t* block) /* in: block */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_block_align(ptr);
|
||||
|
||||
return(block->lock_mutex);
|
||||
}
|
||||
|
||||
|
@ -451,37 +443,9 @@ Increments the modify clock of a frame by 1. The caller must (1) own the
|
|||
buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_frame_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_frame_t* frame) /* in: pointer to a frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
ut_ad(frame);
|
||||
|
||||
block = buf_block_align(frame);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0))
|
||||
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
|
||||
#endif /*UNIV_SYNC_DEBUG */
|
||||
|
||||
UT_DULINT_INC(block->modify_clock);
|
||||
|
||||
return(block->modify_clock);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Increments the modify clock of a frame by 1. The caller must (1) own the
|
||||
buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
void
|
||||
buf_block_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_block_t* block) /* in: block */
|
||||
{
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -490,8 +454,6 @@ buf_block_modify_clock_inc(
|
|||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
UT_DULINT_INC(block->modify_clock);
|
||||
|
||||
return(block->modify_clock);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
|
|
@ -657,7 +657,7 @@ page_t*
|
|||
page_create(
|
||||
/*========*/
|
||||
/* out: pointer to the page */
|
||||
buf_frame_t* frame, /* in/out: a buffer frame where the
|
||||
buf_block_t* block, /* in: a buffer block where the
|
||||
page is created */
|
||||
mtr_t* mtr, /* in: mini-transaction handle */
|
||||
ulint comp); /* in: nonzero=compact page format */
|
||||
|
@ -668,9 +668,8 @@ page_t*
|
|||
page_create_zip(
|
||||
/*============*/
|
||||
/* out: pointer to the page */
|
||||
buf_frame_t* frame, /* in/out: a buffer frame where the
|
||||
buf_block_t* block, /* in/out: a buffer frame where the
|
||||
page is created */
|
||||
page_zip_des_t* page_zip, /* in/out: compressed page, or NULL */
|
||||
dict_index_t* index, /* in: the index of the page */
|
||||
ulint level, /* in: the B-tree level of the page */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
|
@ -841,7 +840,7 @@ page_parse_create(
|
|||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
ulint comp, /* in: nonzero=compact page format */
|
||||
page_t* page, /* in: page or NULL */
|
||||
buf_block_t* block, /* in: block or NULL */
|
||||
mtr_t* mtr); /* in: mtr or NULL */
|
||||
/***************************************************************
|
||||
Parses a redo log record of creating a compressed page. */
|
||||
|
|
|
@ -1265,7 +1265,7 @@ lock_rec_get_first_on_page(
|
|||
ut_ad(mutex_own(&kernel_mutex));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
hash = buf_frame_get_lock_hash_val(ptr);
|
||||
hash = buf_block_get_lock_hash_val(buf_block_align(ptr));
|
||||
|
||||
lock = HASH_GET_FIRST(lock_sys->rec_hash, hash);
|
||||
|
||||
|
|
|
@ -764,19 +764,31 @@ static
|
|||
byte*
|
||||
recv_parse_or_apply_log_rec_body(
|
||||
/*=============================*/
|
||||
/* out: log record end, NULL if not a complete
|
||||
record */
|
||||
byte type, /* in: type */
|
||||
byte* ptr, /* in: pointer to a buffer */
|
||||
byte* end_ptr,/* in: pointer to the buffer end */
|
||||
page_t* page, /* in/out: buffer page or NULL; if not NULL, then the
|
||||
log record is applied to the page, and the log record
|
||||
should be complete then */
|
||||
page_zip_des_t* page_zip,/* in/out: compressed page or NULL */
|
||||
mtr_t* mtr) /* in: mtr or NULL; should be non-NULL if and only if
|
||||
page is non-NULL */
|
||||
/* out: log record end, NULL if not a
|
||||
complete record */
|
||||
byte type, /* in: type */
|
||||
byte* ptr, /* in: pointer to a buffer */
|
||||
byte* end_ptr,/* in: pointer to the buffer end */
|
||||
buf_block_t* block, /* in/out: buffer block or NULL; if
|
||||
not NULL, then the log record is
|
||||
applied to the page, and the log
|
||||
record should be complete then */
|
||||
mtr_t* mtr) /* in: mtr or NULL; should be non-NULL
|
||||
if and only if block is non-NULL */
|
||||
{
|
||||
dict_index_t* index = NULL;
|
||||
dict_index_t* index = NULL;
|
||||
page_t* page;
|
||||
page_zip_des_t* page_zip;
|
||||
|
||||
ut_ad(!block == !mtr);
|
||||
|
||||
if (block) {
|
||||
page = block->frame;
|
||||
page_zip = buf_block_get_page_zip(block);
|
||||
} else {
|
||||
page = NULL;
|
||||
page_zip = NULL;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case MLOG_1BYTE: case MLOG_2BYTES: case MLOG_4BYTES: case MLOG_8BYTES:
|
||||
|
@ -876,7 +888,7 @@ recv_parse_or_apply_log_rec_body(
|
|||
ut_a(!page_zip);
|
||||
ptr = page_parse_create(ptr, end_ptr,
|
||||
type == MLOG_COMP_PAGE_CREATE,
|
||||
page, mtr);
|
||||
block, mtr);
|
||||
break;
|
||||
case MLOG_UNDO_INSERT:
|
||||
ptr = trx_undo_parse_add_undo_rec(ptr, end_ptr, page);
|
||||
|
@ -1155,7 +1167,6 @@ recv_recover_page(
|
|||
buf_block_t* block) /* in: buffer block */
|
||||
{
|
||||
page_t* page;
|
||||
page_zip_des_t* page_zip;
|
||||
recv_addr_t* recv_addr;
|
||||
recv_t* recv;
|
||||
byte* buf;
|
||||
|
@ -1202,7 +1213,6 @@ recv_recover_page(
|
|||
mtr_set_log_mode(&mtr, MTR_LOG_NONE);
|
||||
|
||||
page = block->frame;
|
||||
page_zip = buf_block_get_page_zip(block);
|
||||
|
||||
if (!recover_backup) {
|
||||
if (just_read_in) {
|
||||
|
@ -1296,7 +1306,7 @@ recv_recover_page(
|
|||
|
||||
recv_parse_or_apply_log_rec_body(recv->type, buf,
|
||||
buf + recv->len,
|
||||
page, page_zip, &mtr);
|
||||
block, &mtr);
|
||||
mach_write_to_8(page + UNIV_PAGE_SIZE
|
||||
- FIL_PAGE_END_LSN_OLD_CHKSUM,
|
||||
ut_dulint_add(recv->start_lsn,
|
||||
|
@ -1743,7 +1753,7 @@ recv_parse_log_rec(
|
|||
}
|
||||
|
||||
new_ptr = recv_parse_or_apply_log_rec_body(*type, new_ptr, end_ptr,
|
||||
NULL, NULL, NULL);
|
||||
NULL, NULL);
|
||||
if (UNIV_UNLIKELY(new_ptr == NULL)) {
|
||||
|
||||
return(0);
|
||||
|
|
|
@ -1549,7 +1549,7 @@ page_cur_delete_rec(
|
|||
/* The page gets invalid for optimistic searches: increment the
|
||||
frame modify clock */
|
||||
|
||||
buf_frame_modify_clock_inc(page);
|
||||
buf_block_modify_clock_inc(buf_block_align(page)/*TODO*/);
|
||||
|
||||
/* 2. Find the next and the previous record. Note that the cursor is
|
||||
left at the next record. */
|
||||
|
|
|
@ -285,15 +285,15 @@ page_parse_create(
|
|||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||
ulint comp, /* in: nonzero=compact page format */
|
||||
page_t* page, /* in: page or NULL */
|
||||
buf_block_t* block, /* in: block or NULL */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
ut_ad(ptr && end_ptr);
|
||||
|
||||
/* The record is empty, except for the record initial part */
|
||||
|
||||
if (page) {
|
||||
page_create(page, mtr, comp);
|
||||
if (block) {
|
||||
page_create(block, mtr, comp);
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
|
@ -306,7 +306,7 @@ page_t*
|
|||
page_create_low(
|
||||
/*============*/
|
||||
/* out: pointer to the page */
|
||||
buf_frame_t* frame, /* in/out: a buffer frame where the
|
||||
buf_block_t* block, /* in: a buffer block where the
|
||||
page is created */
|
||||
ulint comp) /* in: nonzero=compact page format */
|
||||
{
|
||||
|
@ -321,7 +321,7 @@ page_create_low(
|
|||
dict_index_t* index;
|
||||
ulint* offsets;
|
||||
|
||||
ut_ad(frame);
|
||||
ut_ad(block);
|
||||
#if PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA
|
||||
# error "PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA"
|
||||
#endif
|
||||
|
@ -337,9 +337,9 @@ page_create_low(
|
|||
}
|
||||
|
||||
/* 1. INCREMENT MODIFY CLOCK */
|
||||
buf_frame_modify_clock_inc(frame);
|
||||
buf_block_modify_clock_inc(block);
|
||||
|
||||
page = frame;
|
||||
page = buf_block_get_frame(block);
|
||||
|
||||
fil_page_set_type(page, FIL_PAGE_INDEX);
|
||||
|
||||
|
@ -459,13 +459,13 @@ page_t*
|
|||
page_create(
|
||||
/*========*/
|
||||
/* out: pointer to the page */
|
||||
buf_frame_t* frame, /* in/out: a buffer frame where the
|
||||
buf_block_t* block, /* in: a buffer block where the
|
||||
page is created */
|
||||
mtr_t* mtr, /* in: mini-transaction handle */
|
||||
ulint comp) /* in: nonzero=compact page format */
|
||||
{
|
||||
page_create_write_log(frame, mtr, comp);
|
||||
return(page_create_low(frame, comp));
|
||||
page_create_write_log(buf_block_get_frame(block), mtr, comp);
|
||||
return(page_create_low(block, comp));
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
|
@ -475,26 +475,28 @@ page_t*
|
|||
page_create_zip(
|
||||
/*============*/
|
||||
/* out: pointer to the page */
|
||||
buf_frame_t* frame, /* in/out: a buffer frame where the
|
||||
buf_block_t* block, /* in/out: a buffer frame where the
|
||||
page is created */
|
||||
page_zip_des_t* page_zip, /* in/out: compressed page, or NULL */
|
||||
dict_index_t* index, /* in: the index of the page */
|
||||
ulint level, /* in: the B-tree level of the page */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(frame && page_zip && index);
|
||||
page_t* page;
|
||||
|
||||
ut_ad(block && buf_block_get_page_zip(block) && index);
|
||||
ut_ad(dict_table_is_comp(index->table));
|
||||
|
||||
page_create_low(frame, TRUE);
|
||||
mach_write_to_2(frame + PAGE_HEADER + PAGE_LEVEL, level);
|
||||
page = page_create_low(block, TRUE);
|
||||
mach_write_to_2(page + PAGE_HEADER + PAGE_LEVEL, level);
|
||||
|
||||
if (UNIV_UNLIKELY(!page_zip_compress(page_zip, frame, index, mtr))) {
|
||||
if (UNIV_UNLIKELY(!page_zip_compress(buf_block_get_page_zip(block),
|
||||
page, index, mtr))) {
|
||||
/* The compression of a newly created page
|
||||
should always succeed. */
|
||||
ut_error;
|
||||
}
|
||||
|
||||
return(frame);
|
||||
return(page);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
|
@ -890,7 +892,7 @@ page_delete_rec_list_end(
|
|||
/* The page gets invalid for optimistic searches: increment the
|
||||
frame modify clock */
|
||||
|
||||
buf_frame_modify_clock_inc(page);
|
||||
buf_block_modify_clock_inc(buf_block_align(page)/*TODO*/);
|
||||
|
||||
page_delete_rec_list_write_log(rec, index, page_is_comp(page)
|
||||
? MLOG_COMP_LIST_END_DELETE
|
||||
|
|
|
@ -3531,8 +3531,8 @@ page_zip_reorganize(
|
|||
/* Recreate the page: note that global data on page (possible
|
||||
segment headers, next page-field, etc.) is preserved intact */
|
||||
|
||||
page_create(page, mtr, dict_table_is_comp(index->table));
|
||||
block = buf_block_align(page);
|
||||
page_create(block, mtr, dict_table_is_comp(index->table));
|
||||
block->check_index_page_at_flush = TRUE;
|
||||
|
||||
/* Copy the records from the temporary space to the recreated page;
|
||||
|
|
Loading…
Reference in a new issue