Commit 44175381 authored by marko's avatar marko

branches/zip: Make page_zip_validate() independent of UNIV_DEBUG.

Replace most occurrences of #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
with #ifdef UNIV_ZIP_DEBUG.
parent 4b00336e
...@@ -877,9 +877,9 @@ btr_page_reorganize_low( ...@@ -877,9 +877,9 @@ btr_page_reorganize_low(
ut_ad(mtr_memo_contains(mtr, buf_block_align(page), ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
data_size1 = page_get_data_size(page); data_size1 = page_get_data_size(page);
max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1); max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);
...@@ -948,9 +948,9 @@ btr_page_reorganize_low( ...@@ -948,9 +948,9 @@ btr_page_reorganize_low(
} }
func_exit: func_exit:
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
buf_frame_free(temp_page); buf_frame_free(temp_page);
/* Restore logging mode */ /* Restore logging mode */
...@@ -1015,9 +1015,9 @@ btr_page_empty( ...@@ -1015,9 +1015,9 @@ btr_page_empty(
{ {
ut_ad(mtr_memo_contains(mtr, buf_block_align(page), ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
btr_search_drop_page_hash_index(page); btr_search_drop_page_hash_index(page);
...@@ -1069,9 +1069,9 @@ btr_root_raise_and_insert( ...@@ -1069,9 +1069,9 @@ btr_root_raise_and_insert(
root = btr_cur_get_page(cursor); root = btr_cur_get_page(cursor);
root_page_zip = buf_block_get_page_zip(buf_block_align(root)); root_page_zip = buf_block_get_page_zip(buf_block_align(root));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!root_page_zip || page_zip_validate(root_page_zip, root)); ut_a(!root_page_zip || page_zip_validate(root_page_zip, root));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
tree = btr_cur_get_tree(cursor); tree = btr_cur_get_tree(cursor);
ut_ad(dict_tree_get_page(tree) == buf_frame_get_page_no(root)); ut_ad(dict_tree_get_page(tree) == buf_frame_get_page_no(root));
...@@ -1882,10 +1882,10 @@ btr_page_split_and_insert( ...@@ -1882,10 +1882,10 @@ btr_page_split_and_insert(
rec = page_cur_tuple_insert(page_cursor, insert_page_zip, rec = page_cur_tuple_insert(page_cursor, insert_page_zip,
tuple, cursor->index, ext, n_ext, mtr); tuple, cursor->index, ext, n_ext, mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!insert_page_zip ut_a(!insert_page_zip
|| page_zip_validate(insert_page_zip, insert_page)); || page_zip_validate(insert_page_zip, insert_page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (UNIV_LIKELY(rec != NULL)) { if (UNIV_LIKELY(rec != NULL)) {
/* Insert fit on the page: update the free bits for the /* Insert fit on the page: update the free bits for the
...@@ -2135,10 +2135,10 @@ btr_lift_page_up( ...@@ -2135,10 +2135,10 @@ btr_lift_page_up(
father_page = buf_frame_align( father_page = buf_frame_align(
btr_page_get_father_node_ptr(tree, page, mtr)); btr_page_get_father_node_ptr(tree, page, mtr));
father_page_zip = buf_block_get_page_zip(buf_block_align(father_page)); father_page_zip = buf_block_get_page_zip(buf_block_align(father_page));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!father_page_zip ut_a(!father_page_zip
|| page_zip_validate(father_page_zip, father_page)); || page_zip_validate(father_page_zip, father_page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
page_level = btr_page_get_level(page, mtr); page_level = btr_page_get_level(page, mtr);
index = tree->tree_index; index = tree->tree_index;
...@@ -2302,13 +2302,13 @@ btr_compress( ...@@ -2302,13 +2302,13 @@ btr_compress(
} }
merge_page_zip = buf_block_get_page_zip(buf_block_align(merge_page)); merge_page_zip = buf_block_get_page_zip(buf_block_align(merge_page));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
if (UNIV_LIKELY_NULL(merge_page_zip)) { if (UNIV_LIKELY_NULL(merge_page_zip)) {
ut_a(page_zip_validate(merge_page_zip, merge_page)); ut_a(page_zip_validate(merge_page_zip, merge_page));
ut_a(page_zip_validate(buf_block_get_page_zip( ut_a(page_zip_validate(buf_block_get_page_zip(
buf_block_align(page)), page)); buf_block_align(page)), page));
} }
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
/* Move records to the merge page */ /* Move records to the merge page */
if (is_left) { if (is_left) {
...@@ -2538,14 +2538,14 @@ btr_discard_page( ...@@ -2538,14 +2538,14 @@ btr_discard_page(
/* Remove the page from the level list */ /* Remove the page from the level list */
btr_level_list_remove(tree, page, mtr); btr_level_list_remove(tree, page, mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
{ {
page_zip_des_t* merge_page_zip = buf_block_get_page_zip( page_zip_des_t* merge_page_zip = buf_block_get_page_zip(
buf_block_align(merge_page)); buf_block_align(merge_page));
ut_a(!merge_page_zip ut_a(!merge_page_zip
|| page_zip_validate(merge_page_zip, merge_page)); || page_zip_validate(merge_page_zip, merge_page));
} }
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (left_page_no != FIL_NULL) { if (left_page_no != FIL_NULL) {
lock_update_discard(page_get_supremum_rec(merge_page), page); lock_update_discard(page_get_supremum_rec(merge_page), page);
...@@ -2970,9 +2970,9 @@ btr_validate_level( ...@@ -2970,9 +2970,9 @@ btr_validate_level(
mem_heap_t* heap = mem_heap_create(256); mem_heap_t* heap = mem_heap_create(256);
ulint* offsets = NULL; ulint* offsets = NULL;
ulint* offsets2= NULL; ulint* offsets2= NULL;
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
mtr_start(&mtr); mtr_start(&mtr);
...@@ -2985,10 +2985,10 @@ btr_validate_level( ...@@ -2985,10 +2985,10 @@ btr_validate_level(
index = tree->tree_index; index = tree->tree_index;
while (level != btr_page_get_level(page, &mtr)) { while (level != btr_page_get_level(page, &mtr)) {
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
page_zip = buf_block_get_page_zip(buf_block_align(page)); page_zip = buf_block_get_page_zip(buf_block_align(page));
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ut_a(!page_is_leaf(page)); ut_a(!page_is_leaf(page));
page_cur_set_before_first(page, &cursor); page_cur_set_before_first(page, &cursor);
...@@ -3012,10 +3012,10 @@ btr_validate_level( ...@@ -3012,10 +3012,10 @@ btr_validate_level(
offsets = offsets2 = NULL; offsets = offsets2 = NULL;
mtr_x_lock(dict_tree_get_lock(tree), &mtr); mtr_x_lock(dict_tree_get_lock(tree), &mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
page_zip = buf_block_get_page_zip(buf_block_align(page)); page_zip = buf_block_get_page_zip(buf_block_align(page));
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
/* Check ordering etc. of records */ /* Check ordering etc. of records */
......
...@@ -501,10 +501,10 @@ btr_cur_search_to_nth_level( ...@@ -501,10 +501,10 @@ btr_cur_search_to_nth_level(
block = buf_block_align(page); block = buf_block_align(page);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!buf_block_get_page_zip(block) || page_zip_validate( ut_a(!buf_block_get_page_zip(block) || page_zip_validate(
buf_block_get_page_zip(block), page)); buf_block_get_page_zip(block), page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
block->check_index_page_at_flush = TRUE; block->check_index_page_at_flush = TRUE;
...@@ -1767,9 +1767,9 @@ btr_cur_optimistic_update( ...@@ -1767,9 +1767,9 @@ btr_cur_optimistic_update(
new_rec_size = rec_get_converted_size(index, new_entry); new_rec_size = rec_get_converted_size(index, new_entry);
page_zip = buf_block_get_page_zip(buf_block_align(page)); page_zip = buf_block_get_page_zip(buf_block_align(page));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (UNIV_LIKELY_NULL(page_zip) if (UNIV_LIKELY_NULL(page_zip)
&& !page_zip_alloc(page_zip, page, index, && !page_zip_alloc(page_zip, page, index,
...@@ -1972,9 +1972,9 @@ btr_cur_pessimistic_update( ...@@ -1972,9 +1972,9 @@ btr_cur_pessimistic_update(
MTR_MEMO_X_LOCK)); MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, buf_block_align(page), ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
optim_err = btr_cur_optimistic_update(flags, cursor, update, optim_err = btr_cur_optimistic_update(flags, cursor, update,
cmpl_info, thr, mtr); cmpl_info, thr, mtr);
...@@ -2092,9 +2092,9 @@ btr_cur_pessimistic_update( ...@@ -2092,9 +2092,9 @@ btr_cur_pessimistic_update(
btr_search_update_hash_on_delete(cursor); btr_search_update_hash_on_delete(cursor);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
page_cur_delete_rec(page_cursor, index, offsets, page_zip, mtr); page_cur_delete_rec(page_cursor, index, offsets, page_zip, mtr);
page_cur_move_to_prev(page_cursor); page_cur_move_to_prev(page_cursor);
...@@ -2624,14 +2624,14 @@ btr_cur_optimistic_delete( ...@@ -2624,14 +2624,14 @@ btr_cur_optimistic_delete(
1); 1);
page_zip = buf_block_get_page_zip(buf_block_align( page_zip = buf_block_get_page_zip(buf_block_align(
btr_cur_get_rec(cursor))); btr_cur_get_rec(cursor)));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUGp #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
page_cur_delete_rec(btr_cur_get_page_cur(cursor), page_cur_delete_rec(btr_cur_get_page_cur(cursor),
cursor->index, offsets, page_zip, mtr); cursor->index, offsets, page_zip, mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUGp #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ibuf_update_free_bits_low(cursor->index, page, max_ins_size, ibuf_update_free_bits_low(cursor->index, page, max_ins_size,
mtr); mtr);
...@@ -2712,9 +2712,9 @@ btr_cur_pessimistic_delete( ...@@ -2712,9 +2712,9 @@ btr_cur_pessimistic_delete(
heap = mem_heap_create(1024); heap = mem_heap_create(1024);
rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
page_zip = buf_block_get_page_zip(buf_block_align(page)); page_zip = buf_block_get_page_zip(buf_block_align(page));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
offsets = rec_get_offsets(rec, cursor->index, offsets = rec_get_offsets(rec, cursor->index,
NULL, ULINT_UNDEFINED, &heap); NULL, ULINT_UNDEFINED, &heap);
...@@ -2727,9 +2727,9 @@ btr_cur_pessimistic_delete( ...@@ -2727,9 +2727,9 @@ btr_cur_pessimistic_delete(
|| !rec_get_1byte_offs_flag(rec))) { || !rec_get_1byte_offs_flag(rec))) {
btr_rec_free_externally_stored_fields(cursor->index, rec, btr_rec_free_externally_stored_fields(cursor->index, rec,
offsets, page_zip, in_rollback, mtr); offsets, page_zip, in_rollback, mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUGp #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
if (UNIV_UNLIKELY(page_get_n_recs(page) < 2) if (UNIV_UNLIKELY(page_get_n_recs(page) < 2)
...@@ -2790,9 +2790,9 @@ btr_cur_pessimistic_delete( ...@@ -2790,9 +2790,9 @@ btr_cur_pessimistic_delete(
page_cur_delete_rec(btr_cur_get_page_cur(cursor), cursor->index, page_cur_delete_rec(btr_cur_get_page_cur(cursor), cursor->index,
offsets, page_zip, mtr); offsets, page_zip, mtr);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUGp #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ut_ad(btr_check_node_ptr(tree, page, mtr)); ut_ad(btr_check_node_ptr(tree, page, mtr));
......
...@@ -69,7 +69,7 @@ page_zip_simple_validate( ...@@ -69,7 +69,7 @@ page_zip_simple_validate(
descriptor */ descriptor */
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
/************************************************************************** /**************************************************************************
Check that the compressed and decompressed pages match. */ Check that the compressed and decompressed pages match. */
...@@ -79,7 +79,7 @@ page_zip_validate( ...@@ -79,7 +79,7 @@ page_zip_validate(
const page_zip_des_t* page_zip,/* in: compressed page */ const page_zip_des_t* page_zip,/* in: compressed page */
const page_t* page) /* in: uncompressed page */ const page_t* page) /* in: uncompressed page */
__attribute__((nonnull)); __attribute__((nonnull));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
/************************************************************************** /**************************************************************************
Ensure that enough space is available in the modification log. Ensure that enough space is available in the modification log.
......
...@@ -160,9 +160,9 @@ page_zip_alloc( ...@@ -160,9 +160,9 @@ page_zip_alloc(
mtr_t* mtr) /* in: mini-transaction, or NULL */ mtr_t* mtr) /* in: mini-transaction, or NULL */
{ {
ut_ad(page_is_comp((page_t*) page)); ut_ad(page_is_comp((page_t*) page));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (page_zip_available(page_zip, index, length, create)) { if (page_zip_available(page_zip, index, length, create)) {
return(TRUE); return(TRUE);
......
...@@ -250,11 +250,11 @@ page_cur_search_with_match( ...@@ -250,11 +250,11 @@ page_cur_search_with_match(
ut_ad((mode == PAGE_CUR_L) || (mode == PAGE_CUR_LE) ut_ad((mode == PAGE_CUR_L) || (mode == PAGE_CUR_LE)
|| (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)); || (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE));
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip = buf_block_get_page_zip( page_zip_des_t* page_zip = buf_block_get_page_zip(
buf_block_align(page)); buf_block_align(page));
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
page_check_dir(page); page_check_dir(page);
...@@ -917,9 +917,9 @@ page_cur_insert_rec_low( ...@@ -917,9 +917,9 @@ page_cur_insert_rec_low(
== (ibool) !!page_is_comp(page)); == (ibool) !!page_is_comp(page));
ut_ad(!page_rec_is_supremum(cursor->rec)); ut_ad(!page_rec_is_supremum(cursor->rec));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
/* 1. Get the size of the physical record in the page */ /* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets); rec_size = rec_offs_size(offsets);
......
...@@ -838,9 +838,9 @@ page_delete_rec_list_end( ...@@ -838,9 +838,9 @@ page_delete_rec_list_end(
ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE); ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE);
ut_ad(!page_zip || page_rec_is_comp(rec)); ut_ad(!page_zip || page_rec_is_comp(rec));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (page_rec_is_infimum(rec)) { if (page_rec_is_infimum(rec)) {
rec = page_rec_get_next(rec); rec = page_rec_get_next(rec);
...@@ -1005,10 +1005,10 @@ page_delete_rec_list_start( ...@@ -1005,10 +1005,10 @@ page_delete_rec_list_start(
ut_ad((ibool) !!page_rec_is_comp(rec) ut_ad((ibool) !!page_rec_is_comp(rec)
== dict_table_is_comp(index->table)); == dict_table_is_comp(index->table));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, ut_a(!page_zip || page_zip_validate(page_zip,
ut_align_down(rec, UNIV_PAGE_SIZE))); ut_align_down(rec, UNIV_PAGE_SIZE)));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (page_rec_is_infimum(rec)) { if (page_rec_is_infimum(rec)) {
...@@ -1071,11 +1071,11 @@ page_move_rec_list_end( ...@@ -1071,11 +1071,11 @@ page_move_rec_list_end(
old_data_size = page_get_data_size(new_page); old_data_size = page_get_data_size(new_page);
old_n_recs = page_get_n_recs(new_page); old_n_recs = page_get_n_recs(new_page);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!new_page_zip || page_zip_validate(new_page_zip, new_page)); ut_a(!new_page_zip || page_zip_validate(new_page_zip, new_page));
ut_a(!page_zip || page_zip_validate(page_zip, ut_a(!page_zip || page_zip_validate(page_zip,
ut_align_down(split_rec, UNIV_PAGE_SIZE))); ut_align_down(split_rec, UNIV_PAGE_SIZE)));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (UNIV_UNLIKELY(!page_copy_rec_list_end(new_page, new_page_zip, if (UNIV_UNLIKELY(!page_copy_rec_list_end(new_page, new_page_zip,
split_rec, index, mtr))) { split_rec, index, mtr))) {
......
...@@ -196,9 +196,9 @@ page_zip_compress_write_log( ...@@ -196,9 +196,9 @@ page_zip_compress_write_log(
byte* log_ptr; byte* log_ptr;
ulint trailer_size; ulint trailer_size;
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
log_ptr = mlog_open(mtr, 11 + 2 + 2); log_ptr = mlog_open(mtr, 11 + 2 + 2);
...@@ -992,9 +992,9 @@ page_zip_compress( ...@@ -992,9 +992,9 @@ page_zip_compress(
/* Copy the rest of the compressed page */ /* Copy the rest of the compressed page */
memcpy(page_zip->data + PAGE_DATA, buf, page_zip->size - PAGE_DATA); memcpy(page_zip->data + PAGE_DATA, buf, page_zip->size - PAGE_DATA);
mem_heap_free(heap); mem_heap_free(heap);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (mtr) { if (mtr) {
page_zip_compress_write_log(page_zip, page, index, mtr); page_zip_compress_write_log(page_zip, page, index, mtr);
...@@ -1965,7 +1965,7 @@ page_zip_decompress( ...@@ -1965,7 +1965,7 @@ page_zip_decompress(
return(TRUE); return(TRUE);
} }
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
/* Flag: make page_zip_validate() compare page headers only */ /* Flag: make page_zip_validate() compare page headers only */
ibool page_zip_validate_header_only = FALSE; ibool page_zip_validate_header_only = FALSE;
...@@ -2039,7 +2039,7 @@ page_zip_validate( ...@@ -2039,7 +2039,7 @@ page_zip_validate(
buf_frame_free(temp_page); buf_frame_free(temp_page);
return(valid); return(valid);
} }
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
static static
...@@ -2294,10 +2294,10 @@ page_zip_write_rec( ...@@ -2294,10 +2294,10 @@ page_zip_write_rec(
ut_a(!*data); ut_a(!*data);
page_zip->m_end = data - page_zip->data; page_zip->m_end = data - page_zip->data;
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, ut_a(page_zip_validate(page_zip,
ut_align_down((byte*) rec, UNIV_PAGE_SIZE))); ut_align_down((byte*) rec, UNIV_PAGE_SIZE)));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
/*************************************************************** /***************************************************************
...@@ -2341,18 +2341,18 @@ page_zip_parse_write_blob_ptr( ...@@ -2341,18 +2341,18 @@ page_zip_parse_write_blob_ptr(
goto corrupt; goto corrupt;
} }
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
memcpy(page + offset, memcpy(page + offset,
ptr + 4, BTR_EXTERN_FIELD_REF_SIZE); ptr + 4, BTR_EXTERN_FIELD_REF_SIZE);
memcpy(page_zip->data + z_offset, memcpy(page_zip->data + z_offset,
ptr + 4, BTR_EXTERN_FIELD_REF_SIZE); ptr + 4, BTR_EXTERN_FIELD_REF_SIZE);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
return(ptr + (2 + 2 + BTR_EXTERN_FIELD_REF_SIZE)); return(ptr + (2 + 2 + BTR_EXTERN_FIELD_REF_SIZE));
...@@ -2415,10 +2415,10 @@ page_zip_write_blob_ptr( ...@@ -2415,10 +2415,10 @@ page_zip_write_blob_ptr(
memcpy(externs, field, BTR_EXTERN_FIELD_REF_SIZE); memcpy(externs, field, BTR_EXTERN_FIELD_REF_SIZE);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, ut_a(page_zip_validate(page_zip,
ut_align_down((rec_t*) rec, UNIV_PAGE_SIZE))); ut_align_down((rec_t*) rec, UNIV_PAGE_SIZE)));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (mtr) { if (mtr) {
byte* log_ptr = mlog_open(mtr, byte* log_ptr = mlog_open(mtr,
...@@ -2486,9 +2486,9 @@ page_zip_parse_write_node_ptr( ...@@ -2486,9 +2486,9 @@ page_zip_parse_write_node_ptr(
goto corrupt; goto corrupt;
} }
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
field = page + offset; field = page + offset;
storage = page_zip->data + z_offset; storage = page_zip->data + z_offset;
...@@ -2509,9 +2509,9 @@ page_zip_parse_write_node_ptr( ...@@ -2509,9 +2509,9 @@ page_zip_parse_write_node_ptr(
memcpy(field, ptr + 4, REC_NODE_PTR_SIZE); memcpy(field, ptr + 4, REC_NODE_PTR_SIZE);
memcpy(storage, ptr + 4, REC_NODE_PTR_SIZE); memcpy(storage, ptr + 4, REC_NODE_PTR_SIZE);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
return(ptr + (2 + 2 + REC_NODE_PTR_SIZE)); return(ptr + (2 + 2 + REC_NODE_PTR_SIZE));
...@@ -2701,9 +2701,9 @@ page_zip_clear_rec( ...@@ -2701,9 +2701,9 @@ page_zip_clear_rec(
*data++ = (heap_no - 1) << 1 | 1; *data++ = (heap_no - 1) << 1 | 1;
ut_ad(!*data); ut_ad(!*data);
page_zip->m_end = data - page_zip->data; page_zip->m_end = data - page_zip->data;
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} else { } else {
/* There is not enough space to log the clearing. /* There is not enough space to log the clearing.
Try to clear the block and to recompress the page. */ Try to clear the block and to recompress the page. */
...@@ -2975,16 +2975,16 @@ page_zip_parse_write_header( ...@@ -2975,16 +2975,16 @@ page_zip_parse_write_header(
goto corrupt; goto corrupt;
} }
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
memcpy(page + offset, ptr, len); memcpy(page + offset, ptr, len);
memcpy(page_zip->data + offset, ptr, len); memcpy(page_zip->data + offset, ptr, len);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
} }
return(ptr + len); return(ptr + len);
...@@ -3109,9 +3109,9 @@ page_zip_copy( ...@@ -3109,9 +3109,9 @@ page_zip_copy(
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
ut_ad(mtr_memo_contains(mtr, buf_block_align((page_t*) src), ut_ad(mtr_memo_contains(mtr, buf_block_align((page_t*) src),
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(src_zip, src)); ut_a(page_zip_validate(src_zip, src));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ut_a(page_zip->size == src_zip->size); ut_a(page_zip->size == src_zip->size);
/* Skip the file page header and trailer. */ /* Skip the file page header and trailer. */
...@@ -3142,9 +3142,9 @@ page_zip_copy( ...@@ -3142,9 +3142,9 @@ page_zip_copy(
} }
} }
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
page_zip_compress_write_log(page_zip, page, index, mtr); page_zip_compress_write_log(page_zip, page, index, mtr);
} }
......
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