Commit a3860f71 authored by marko's avatar marko

branches/zip: Remove some more buf_block_align() calls.

btr_search_build_page_hash_index(), fsp_parse_init_file_page(),
ibuf_parse_bitmap_init(): Replace page_t* with buf_block_t*.

buf_read_ibuf_merge_pages(): Add const qualifiers.  Retrieve zip_size.

ibuf_merge_or_delete_for_page(): Replace page_t* with buf_block_t*.
Add parameter zip_size.
parent 223cb222
...@@ -70,7 +70,7 @@ btr_search_build_page_hash_index( ...@@ -70,7 +70,7 @@ btr_search_build_page_hash_index(
/*=============================*/ /*=============================*/
dict_index_t* index, /* in: index for which to build, or NULL if dict_index_t* index, /* in: index for which to build, or NULL if
not known */ not known */
page_t* page, /* in: index page, s- or x-latched */ buf_block_t* block, /* in: index page, s- or x-latched */
ulint n_fields,/* in: hash this many full fields */ ulint n_fields,/* in: hash this many full fields */
ulint n_bytes,/* in: hash this many bytes from the next ulint n_bytes,/* in: hash this many bytes from the next
field */ field */
...@@ -514,7 +514,7 @@ btr_search_info_update_slow( ...@@ -514,7 +514,7 @@ btr_search_info_update_slow(
params2 = params + btr_search_this_is_zero; params2 = params + btr_search_this_is_zero;
btr_search_build_page_hash_index(cursor->index, btr_search_build_page_hash_index(cursor->index,
block->frame, block,
params2[0], params2[0],
params2[1], params2[1],
params2[2]); params2[2]);
...@@ -1096,14 +1096,14 @@ void ...@@ -1096,14 +1096,14 @@ void
btr_search_build_page_hash_index( btr_search_build_page_hash_index(
/*=============================*/ /*=============================*/
dict_index_t* index, /* in: index for which to build */ dict_index_t* index, /* in: index for which to build */
page_t* page, /* in: index page, s- or x-latched */ buf_block_t* block, /* in: index page, s- or x-latched */
ulint n_fields,/* in: hash this many full fields */ ulint n_fields,/* in: hash this many full fields */
ulint n_bytes,/* in: hash this many bytes from the next ulint n_bytes,/* in: hash this many bytes from the next
field */ field */
ibool left_side)/* in: hash for searches from left side? */ ibool left_side)/* in: hash for searches from left side? */
{ {
hash_table_t* table; hash_table_t* table;
buf_block_t* block; page_t* page;
rec_t* rec; rec_t* rec;
rec_t* next_rec; rec_t* next_rec;
ulint fold; ulint fold;
...@@ -1121,8 +1121,8 @@ btr_search_build_page_hash_index( ...@@ -1121,8 +1121,8 @@ btr_search_build_page_hash_index(
ut_ad(index); ut_ad(index);
block = buf_block_align(page);
table = btr_search_sys->hash_index; table = btr_search_sys->hash_index;
page = buf_block_get_frame(block);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX)); ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
...@@ -1173,8 +1173,7 @@ btr_search_build_page_hash_index( ...@@ -1173,8 +1173,7 @@ btr_search_build_page_hash_index(
index_id = btr_page_get_index_id(page); index_id = btr_page_get_index_id(page);
rec = page_get_infimum_rec(page); rec = page_rec_get_next(page_get_infimum_rec(page));
rec = page_rec_get_next(rec);
offsets = rec_get_offsets(rec, index, offsets, offsets = rec_get_offsets(rec, index, offsets,
n_fields + (n_bytes > 0), &heap); n_fields + (n_bytes > 0), &heap);
...@@ -1327,7 +1326,7 @@ btr_search_move_or_delete_hash_entries( ...@@ -1327,7 +1326,7 @@ btr_search_move_or_delete_hash_entries(
ut_a(n_fields + n_bytes > 0); ut_a(n_fields + n_bytes > 0);
btr_search_build_page_hash_index(index, new_page, n_fields, btr_search_build_page_hash_index(index, new_block, n_fields,
n_bytes, left_side); n_bytes, left_side);
#if 1 /* TODO: safe to remove? */ #if 1 /* TODO: safe to remove? */
ut_a(n_fields == block->curr_n_fields); ut_a(n_fields == block->curr_n_fields);
...@@ -1362,7 +1361,7 @@ btr_search_update_hash_on_delete( ...@@ -1362,7 +1361,7 @@ btr_search_update_hash_on_delete(
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
block = buf_block_align(rec); block = btr_cur_get_block(cursor);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX)); ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
...@@ -1409,7 +1408,7 @@ btr_search_update_hash_node_on_insert( ...@@ -1409,7 +1408,7 @@ btr_search_update_hash_node_on_insert(
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
block = buf_block_align(rec); block = btr_cur_get_block(cursor);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX)); ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
...@@ -1477,7 +1476,7 @@ btr_search_update_hash_on_insert( ...@@ -1477,7 +1476,7 @@ btr_search_update_hash_on_insert(
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
block = buf_block_align(rec); block = btr_cur_get_block(cursor);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX)); ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
......
...@@ -1884,7 +1884,7 @@ buf_page_create( ...@@ -1884,7 +1884,7 @@ buf_page_create(
/* Delete possible entries for the page from the insert buffer: /* Delete possible entries for the page from the insert buffer:
such can exist if the page belonged to an index which was dropped */ such can exist if the page belonged to an index which was dropped */
ibuf_merge_or_delete_for_page(NULL, space, offset, TRUE); ibuf_merge_or_delete_for_page(NULL, space, offset, zip_size, TRUE);
/* Flush pages from the end of the LRU list if necessary */ /* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin(); buf_flush_free_margin();
...@@ -2065,8 +2065,8 @@ buf_page_io_complete( ...@@ -2065,8 +2065,8 @@ buf_page_io_complete(
if (!recv_no_ibuf_operations) { if (!recv_no_ibuf_operations) {
ibuf_merge_or_delete_for_page( ibuf_merge_or_delete_for_page(
block->frame, block->space, block->offset, block, block->space, block->offset,
TRUE); buf_block_get_zip_size(block), TRUE);
} }
} }
......
...@@ -98,7 +98,7 @@ buf_read_page_low( ...@@ -98,7 +98,7 @@ buf_read_page_low(
} }
if (ibuf_bitmap_page(zip_size, offset) if (ibuf_bitmap_page(zip_size, offset)
|| trx_sys_hdr_page(space, offset)) { || trx_sys_hdr_page(space, offset)) {
/* Trx sys header is so low in the latching order that we play /* Trx sys header is so low in the latching order that we play
safe and do not leave the i/o-completion to an asynchronous safe and do not leave the i/o-completion to an asynchronous
...@@ -612,20 +612,26 @@ a read-ahead function. */ ...@@ -612,20 +612,26 @@ a read-ahead function. */
void void
buf_read_ibuf_merge_pages( buf_read_ibuf_merge_pages(
/*======================*/ /*======================*/
ibool sync, /* in: TRUE if the caller wants this function ibool sync, /* in: TRUE if the caller
to wait for the highest address page to get wants this function to wait
read in, before this function returns */ for the highest address page
ulint* space_ids, /* in: array of space ids */ to get read in, before this
ib_longlong* space_versions,/* in: the spaces must have this version function returns */
number (timestamp), otherwise we discard the const ulint* space_ids, /* in: array of space ids */
read; we use this to cancel reads if const ib_longlong* space_versions,/* in: the spaces must have
DISCARD + IMPORT may have changed the this version number
tablespace size */ (timestamp), otherwise we
ulint* page_nos, /* in: array of page numbers to read, with the discard the read; we use this
highest page number the last in the array */ to cancel reads if DISCARD +
ulint n_stored) /* in: number of page numbers in the array */ IMPORT may have changed the
tablespace size */
const ulint* page_nos, /* in: array of page numbers
to read, with the highest page
number the last in the
array */
ulint n_stored) /* in: number of elements
in the arrays */
{ {
ulint err;
ulint i; ulint i;
ut_ad(!ibuf_inside()); ut_ad(!ibuf_inside());
...@@ -638,16 +644,27 @@ buf_read_ibuf_merge_pages( ...@@ -638,16 +644,27 @@ buf_read_ibuf_merge_pages(
} }
for (i = 0; i < n_stored; i++) { for (i = 0; i < n_stored; i++) {
ulint zip_size = fil_space_get_zip_size(space_ids[i]);
ulint err;
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
goto tablespace_deleted;
}
buf_read_page_low(&err, sync && (i + 1 == n_stored), buf_read_page_low(&err, sync && (i + 1 == n_stored),
BUF_READ_ANY_PAGE, space_ids[i], 0, BUF_READ_ANY_PAGE, space_ids[i],
space_versions[i], page_nos[i]); zip_size, space_versions[i],
page_nos[i]);
if (err == DB_TABLESPACE_DELETED) { if (UNIV_UNLIKELY(err == DB_TABLESPACE_DELETED)) {
tablespace_deleted:
/* We have deleted or are deleting the single-table /* We have deleted or are deleting the single-table
tablespace: remove the entries for that page */ tablespace: remove the entries for that page */
ibuf_merge_or_delete_for_page(NULL, space_ids[i], ibuf_merge_or_delete_for_page(NULL, space_ids[i],
page_nos[i], FALSE); page_nos[i],
zip_size, FALSE);
} }
} }
......
...@@ -869,15 +869,15 @@ Parses a redo log record of a file page init. */ ...@@ -869,15 +869,15 @@ Parses a redo log record of a file page init. */
byte* byte*
fsp_parse_init_file_page( fsp_parse_init_file_page(
/*=====================*/ /*=====================*/
/* out: end of log record or NULL */ /* out: end of log record or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr __attribute__((unused)), /* in: buffer end */ byte* end_ptr __attribute__((unused)), /* in: buffer end */
page_t* page) /* in: page or NULL */ buf_block_t* block) /* in: block or NULL */
{ {
ut_ad(ptr && end_ptr); ut_ad(ptr && end_ptr);
if (page) { if (block) {
fsp_init_file_page_low(buf_block_align(page)); fsp_init_file_page_low(block);
} }
return(ptr); return(ptr);
......
...@@ -595,16 +595,16 @@ Parses a redo log record of an ibuf bitmap page init. */ ...@@ -595,16 +595,16 @@ Parses a redo log record of an ibuf bitmap page init. */
byte* byte*
ibuf_parse_bitmap_init( ibuf_parse_bitmap_init(
/*===================*/ /*===================*/
/* out: end of log record or NULL */ /* out: end of log record or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr __attribute__((unused)), /* in: buffer end */ byte* end_ptr __attribute__((unused)), /* in: buffer end */
page_t* page, /* in: page or NULL */ buf_block_t* block, /* in: block or NULL */
mtr_t* mtr) /* in: mtr or NULL */ mtr_t* mtr) /* in: mtr or NULL */
{ {
ut_ad(ptr && end_ptr); ut_ad(ptr && end_ptr);
if (page) { if (block) {
ibuf_bitmap_page_init(buf_block_align(page), mtr); ibuf_bitmap_page_init(block, mtr);
} }
return(ptr); return(ptr);
...@@ -3117,33 +3117,39 @@ belonged to an index which subsequently was dropped. */ ...@@ -3117,33 +3117,39 @@ belonged to an index which subsequently was dropped. */
void void
ibuf_merge_or_delete_for_page( ibuf_merge_or_delete_for_page(
/*==========================*/ /*==========================*/
page_t* page, /* in: if page has been read from disk, pointer to buf_block_t* block, /* in: if page has been read from
the page x-latched, else NULL */ disk, pointer to the page x-latched,
ulint space, /* in: space id of the index page */ else NULL */
ulint page_no,/* in: page number of the index page */ ulint space, /* in: space id of the index page */
ibool update_ibuf_bitmap)/* in: normally this is set to TRUE, but if ulint page_no,/* in: page number of the index page */
we have deleted or are deleting the tablespace, then we ulint zip_size,/* in: compressed page size in bytes,
naturally do not want to update a non-existent bitmap or 0 */
page */ ibool update_ibuf_bitmap)/* in: normally this is set
to TRUE, but if we have deleted or are
deleting the tablespace, then we
naturally do not want to update a
non-existent bitmap page */
{ {
mem_heap_t* heap; mem_heap_t* heap;
btr_pcur_t pcur; btr_pcur_t pcur;
dtuple_t* entry; dtuple_t* entry;
dtuple_t* search_tuple; dtuple_t* search_tuple;
rec_t* ibuf_rec; rec_t* ibuf_rec;
buf_block_t* block = NULL;
page_t* bitmap_page; page_t* bitmap_page;
ibuf_data_t* ibuf_data; ibuf_data_t* ibuf_data;
ulint n_inserts; ulint n_inserts;
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
ulint volume; ulint volume;
#endif #endif
ulint zip_size = 0; /* remove bogus warning */
page_zip_des_t* page_zip = NULL; page_zip_des_t* page_zip = NULL;
ibool tablespace_being_deleted = FALSE; ibool tablespace_being_deleted = FALSE;
ibool corruption_noticed = FALSE; ibool corruption_noticed = FALSE;
mtr_t mtr; mtr_t mtr;
ut_ad(!block || buf_block_get_space(block) == space);
ut_ad(!block || buf_block_get_page_no(block) == page_no);
ut_ad(!block || buf_block_get_zip_size(block) == zip_size);
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
return; return;
...@@ -3161,7 +3167,6 @@ ibuf_merge_or_delete_for_page( ...@@ -3161,7 +3167,6 @@ ibuf_merge_or_delete_for_page(
} }
if (update_ibuf_bitmap) { if (update_ibuf_bitmap) {
zip_size = fil_space_get_zip_size(space);
ut_a(ut_is_2pow(zip_size)); ut_a(ut_is_2pow(zip_size));
if (ibuf_fixed_addr_page(space, zip_size, page_no) if (ibuf_fixed_addr_page(space, zip_size, page_no)
...@@ -3180,7 +3185,7 @@ ibuf_merge_or_delete_for_page( ...@@ -3180,7 +3185,7 @@ ibuf_merge_or_delete_for_page(
/* Do not try to read the bitmap page from space; /* Do not try to read the bitmap page from space;
just delete the ibuf records for the page */ just delete the ibuf records for the page */
page = NULL; block = NULL;
update_ibuf_bitmap = FALSE; update_ibuf_bitmap = FALSE;
} else { } else {
mtr_start(&mtr); mtr_start(&mtr);
...@@ -3202,10 +3207,7 @@ ibuf_merge_or_delete_for_page( ...@@ -3202,10 +3207,7 @@ ibuf_merge_or_delete_for_page(
} }
mtr_commit(&mtr); mtr_commit(&mtr);
} }
} else if (page) { } else if (block) {
zip_size = fil_space_get_zip_size(space);
ut_a(ut_is_2pow(zip_size));
if (ibuf_fixed_addr_page(space, zip_size, page_no) if (ibuf_fixed_addr_page(space, zip_size, page_no)
|| fsp_descr_page(zip_size, page_no)) { || fsp_descr_page(zip_size, page_no)) {
return; return;
...@@ -3229,17 +3231,17 @@ ibuf_merge_or_delete_for_page( ...@@ -3229,17 +3231,17 @@ ibuf_merge_or_delete_for_page(
heap); heap);
} }
if (page) { if (block) {
/* Move the ownership of the x-latch on the page to this OS /* Move the ownership of the x-latch on the page to this OS
thread, so that we can acquire a second x-latch on it. This thread, so that we can acquire a second x-latch on it. This
is needed for the insert operations to the index page to pass is needed for the insert operations to the index page to pass
the debug checks. */ the debug checks. */
block = buf_block_align(page);
rw_lock_x_lock_move_ownership(&(block->lock)); rw_lock_x_lock_move_ownership(&(block->lock));
page_zip = buf_block_get_page_zip(block); page_zip = buf_block_get_page_zip(block);
if (UNIV_UNLIKELY(fil_page_get_type(page) != FIL_PAGE_INDEX)) { if (UNIV_UNLIKELY(fil_page_get_type(buf_block_get_frame(block))
!= FIL_PAGE_INDEX)) {
corruption_noticed = TRUE; corruption_noticed = TRUE;
...@@ -3258,7 +3260,7 @@ ibuf_merge_or_delete_for_page( ...@@ -3258,7 +3260,7 @@ ibuf_merge_or_delete_for_page(
fputs("\nInnoDB: Dump of the page:\n", stderr); fputs("\nInnoDB: Dump of the page:\n", stderr);
buf_page_print(page, 0); buf_page_print(buf_block_get_frame(block), 0);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: corruption in the tablespace." "InnoDB: Error: corruption in the tablespace."
...@@ -3276,7 +3278,8 @@ ibuf_merge_or_delete_for_page( ...@@ -3276,7 +3278,8 @@ ibuf_merge_or_delete_for_page(
"InnoDB: Please submit a detailed bug report" "InnoDB: Please submit a detailed bug report"
" to http://bugs.mysql.com\n\n", " to http://bugs.mysql.com\n\n",
(ulong) page_no, (ulong) page_no,
(ulong) fil_page_get_type(page)); (ulong)
fil_page_get_type(buf_block_get_frame(block)));
} }
} }
...@@ -3287,7 +3290,7 @@ ibuf_merge_or_delete_for_page( ...@@ -3287,7 +3290,7 @@ ibuf_merge_or_delete_for_page(
loop: loop:
mtr_start(&mtr); mtr_start(&mtr);
if (page) { if (block) {
ibool success = buf_page_get_known_nowait(RW_X_LATCH, block, ibool success = buf_page_get_known_nowait(RW_X_LATCH, block,
BUF_KEEP_OLD, BUF_KEEP_OLD,
__FILE__, __LINE__, __FILE__, __LINE__,
...@@ -3316,9 +3319,10 @@ ibuf_merge_or_delete_for_page( ...@@ -3316,9 +3319,10 @@ ibuf_merge_or_delete_for_page(
/* Check if the entry is for this index page */ /* Check if the entry is for this index page */
if (ibuf_rec_get_page_no(ibuf_rec) != page_no if (ibuf_rec_get_page_no(ibuf_rec) != page_no
|| ibuf_rec_get_space(ibuf_rec) != space) { || ibuf_rec_get_space(ibuf_rec) != space) {
if (page) { if (block) {
page_header_reset_last_insert(page, page_header_reset_last_insert(
page_zip, &mtr); buf_block_get_frame(block),
page_zip, &mtr);
} }
goto reset_bit; goto reset_bit;
} }
...@@ -3327,7 +3331,7 @@ ibuf_merge_or_delete_for_page( ...@@ -3327,7 +3331,7 @@ ibuf_merge_or_delete_for_page(
fputs("InnoDB: Discarding record\n ", stderr); fputs("InnoDB: Discarding record\n ", stderr);
rec_print_old(stderr, ibuf_rec); rec_print_old(stderr, ibuf_rec);
fputs("\n from the insert buffer!\n\n", stderr); fputs("\n from the insert buffer!\n\n", stderr);
} else if (page) { } else if (block) {
/* Now we have at pcur a record which should be /* Now we have at pcur a record which should be
inserted to the index page; NOTE that the call below inserted to the index page; NOTE that the call below
copies pointers to fields in ibuf_rec, and we must copies pointers to fields in ibuf_rec, and we must
...@@ -3336,7 +3340,8 @@ ibuf_merge_or_delete_for_page( ...@@ -3336,7 +3340,8 @@ ibuf_merge_or_delete_for_page(
dict_index_t* dummy_index; dict_index_t* dummy_index;
dulint max_trx_id = page_get_max_trx_id( dulint max_trx_id = page_get_max_trx_id(
page_align(ibuf_rec)); page_align(ibuf_rec));
page_update_max_trx_id(page, page_zip, max_trx_id); page_update_max_trx_id(buf_block_get_frame(block),
page_zip, max_trx_id);
entry = ibuf_build_entry_from_ibuf_rec( entry = ibuf_build_entry_from_ibuf_rec(
ibuf_rec, heap, &dummy_index); ibuf_rec, heap, &dummy_index);
...@@ -3383,7 +3388,8 @@ ibuf_merge_or_delete_for_page( ...@@ -3383,7 +3388,8 @@ ibuf_merge_or_delete_for_page(
zip_size, &mtr); zip_size, &mtr);
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size, ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
IBUF_BITMAP_BUFFERED, FALSE, &mtr); IBUF_BITMAP_BUFFERED, FALSE, &mtr);
if (page) { if (block) {
page_t* page = buf_block_get_frame(block);
ulint old_bits = ibuf_bitmap_page_get_bits( ulint old_bits = ibuf_bitmap_page_get_bits(
bitmap_page, page_no, zip_size, bitmap_page, page_no, zip_size,
IBUF_BITMAP_FREE, &mtr); IBUF_BITMAP_FREE, &mtr);
......
...@@ -65,18 +65,25 @@ a read-ahead function. */ ...@@ -65,18 +65,25 @@ a read-ahead function. */
void void
buf_read_ibuf_merge_pages( buf_read_ibuf_merge_pages(
/*======================*/ /*======================*/
ibool sync, /* in: TRUE if the caller wants this function ibool sync, /* in: TRUE if the caller
to wait for the highest address page to get wants this function to wait
read in, before this function returns */ for the highest address page
ulint* space_ids, /* in: array of space ids */ to get read in, before this
ib_longlong* space_versions,/* in: the spaces must have this version function returns */
number (timestamp), otherwise we discard the const ulint* space_ids, /* in: array of space ids */
read; we use this to cancel reads if const ib_longlong* space_versions,/* in: the spaces must have
DISCARD + IMPORT may have changed the this version number
tablespace size */ (timestamp), otherwise we
ulint* page_nos, /* in: array of page numbers to read, with the discard the read; we use this
highest page number the last in the array */ to cancel reads if DISCARD +
ulint n_stored); /* in: number of page numbers in the array */ IMPORT may have changed the
tablespace size */
const ulint* page_nos, /* in: array of page numbers
to read, with the highest page
number the last in the
array */
ulint n_stored); /* in: number of elements
in the arrays */
/************************************************************************ /************************************************************************
Issues read requests for pages which recovery wants to read in. */ Issues read requests for pages which recovery wants to read in. */
......
...@@ -327,10 +327,10 @@ Parses a redo log record of a file page init. */ ...@@ -327,10 +327,10 @@ Parses a redo log record of a file page init. */
byte* byte*
fsp_parse_init_file_page( fsp_parse_init_file_page(
/*=====================*/ /*=====================*/
/* out: end of log record or NULL */ /* out: end of log record or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */ byte* end_ptr, /* in: buffer end */
page_t* page); /* in: page or NULL */ buf_block_t* block); /* in: block or NULL */
/*********************************************************************** /***********************************************************************
Validates the file space system and its segments. */ Validates the file space system and its segments. */
......
...@@ -200,14 +200,18 @@ belonged to an index which subsequently was dropped. */ ...@@ -200,14 +200,18 @@ belonged to an index which subsequently was dropped. */
void void
ibuf_merge_or_delete_for_page( ibuf_merge_or_delete_for_page(
/*==========================*/ /*==========================*/
page_t* page, /* in: if page has been read from disk, pointer to buf_block_t* block, /* in: if page has been read from
the page x-latched, else NULL */ disk, pointer to the page x-latched,
ulint space, /* in: space id of the index page */ else NULL */
ulint page_no,/* in: page number of the index page */ ulint space, /* in: space id of the index page */
ibool update_ibuf_bitmap);/* in: normally this is set to TRUE, but if ulint page_no,/* in: page number of the index page */
we have deleted or are deleting the tablespace, then we ulint zip_size,/* in: compressed page size in bytes,
naturally do not want to update a non-existent bitmap or 0 */
page */ ibool update_ibuf_bitmap);/* in: normally this is set
to TRUE, but if we have deleted or are
deleting the tablespace, then we
naturally do not want to update a
non-existent bitmap page */
/************************************************************************* /*************************************************************************
Deletes all entries in the insert buffer for a given space id. This is used Deletes all entries in the insert buffer for a given space id. This is used
in DISCARD TABLESPACE and IMPORT TABLESPACE. in DISCARD TABLESPACE and IMPORT TABLESPACE.
...@@ -251,11 +255,11 @@ Parses a redo log record of an ibuf bitmap page init. */ ...@@ -251,11 +255,11 @@ Parses a redo log record of an ibuf bitmap page init. */
byte* byte*
ibuf_parse_bitmap_init( ibuf_parse_bitmap_init(
/*===================*/ /*===================*/
/* out: end of log record or NULL */ /* out: end of log record or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */ byte* end_ptr,/* in: buffer end */
page_t* page, /* in: page or NULL */ buf_block_t* block, /* in: block or NULL */
mtr_t* mtr); /* in: mtr or NULL */ mtr_t* mtr); /* in: mtr or NULL */
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
/********************************************************************** /**********************************************************************
Gets the ibuf count for a given page. */ Gets the ibuf count for a given page. */
......
...@@ -930,10 +930,10 @@ recv_parse_or_apply_log_rec_body( ...@@ -930,10 +930,10 @@ recv_parse_or_apply_log_rec_body(
} }
break; break;
case MLOG_IBUF_BITMAP_INIT: case MLOG_IBUF_BITMAP_INIT:
ptr = ibuf_parse_bitmap_init(ptr, end_ptr, page, mtr); ptr = ibuf_parse_bitmap_init(ptr, end_ptr, block, mtr);
break; break;
case MLOG_INIT_FILE_PAGE: case MLOG_INIT_FILE_PAGE:
ptr = fsp_parse_init_file_page(ptr, end_ptr, page); ptr = fsp_parse_init_file_page(ptr, end_ptr, block);
break; break;
case MLOG_WRITE_STRING: case MLOG_WRITE_STRING:
ptr = mlog_parse_string(ptr, end_ptr, page, page_zip); ptr = mlog_parse_string(ptr, end_ptr, page, page_zip);
......
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