Commit 8378c349 authored by marko's avatar marko

branches/zip: Replace all ut_ad(page_zip_validate()) assertions with

ut_a(page_zip_validate()) that are enabled if UNIV_DEBUG or
UNIV_ZIP_DEBUG is defined.
parent 49d25239
...@@ -877,7 +877,9 @@ btr_page_reorganize_low( ...@@ -877,7 +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));
ut_ad(!page_zip || page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || 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);
...@@ -946,7 +948,9 @@ btr_page_reorganize_low( ...@@ -946,7 +948,9 @@ btr_page_reorganize_low(
} }
func_exit: func_exit:
ut_ad(!page_zip || page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
buf_frame_free(temp_page); buf_frame_free(temp_page);
/* Restore logging mode */ /* Restore logging mode */
...@@ -1011,7 +1015,9 @@ btr_page_empty( ...@@ -1011,7 +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));
ut_ad(!page_zip || page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
btr_search_drop_page_hash_index(page); btr_search_drop_page_hash_index(page);
...@@ -1873,8 +1879,10 @@ func_start: ...@@ -1873,8 +1879,10 @@ func_start:
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);
ut_ad(!insert_page_zip #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
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 */
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
...@@ -2932,9 +2940,9 @@ btr_validate_level( ...@@ -2932,9 +2940,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;
#ifdef UNIV_DEBUG #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
#endif #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
mtr_start(&mtr); mtr_start(&mtr);
...@@ -2947,10 +2955,10 @@ btr_validate_level( ...@@ -2947,10 +2955,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)) {
#ifdef UNIV_DEBUG #if defined UNIV_DEBUG || defined 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_ad(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif #endif /* UNIV_DEBUG || 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);
...@@ -2974,10 +2982,10 @@ loop: ...@@ -2974,10 +2982,10 @@ loop:
offsets = offsets2 = NULL; offsets = offsets2 = NULL;
mtr_x_lock(dict_tree_get_lock(tree), &mtr); mtr_x_lock(dict_tree_get_lock(tree), &mtr);
#ifdef UNIV_DEBUG #if defined UNIV_DEBUG || defined 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_ad(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
/* Check ordering etc. of records */ /* Check ordering etc. of records */
......
...@@ -501,8 +501,10 @@ retry_page_get: ...@@ -501,8 +501,10 @@ retry_page_get:
block = buf_block_align(page); block = buf_block_align(page);
ut_ad(!buf_block_get_page_zip(block) || page_zip_validate( #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
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 */
block->check_index_page_at_flush = TRUE; block->check_index_page_at_flush = TRUE;
......
...@@ -160,7 +160,9 @@ page_zip_alloc( ...@@ -160,7 +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));
ut_ad(page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || 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);
......
...@@ -249,10 +249,12 @@ page_cur_search_with_match( ...@@ -249,10 +249,12 @@ page_cur_search_with_match(
# endif /* PAGE_CUR_LE_OR_EXTENDS */ # endif /* PAGE_CUR_LE_OR_EXTENDS */
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 */
#if defined UNIV_DEBUG || defined 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_ad(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
page_check_dir(page); page_check_dir(page);
...@@ -915,7 +917,9 @@ page_cur_insert_rec_low( ...@@ -915,7 +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));
ut_ad(!page_zip || page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || 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);
...@@ -1510,7 +1514,9 @@ page_cur_delete_rec( ...@@ -1510,7 +1514,9 @@ page_cur_delete_rec(
current_rec = cursor->rec; current_rec = cursor->rec;
ut_ad(rec_offs_validate(current_rec, index, offsets)); ut_ad(rec_offs_validate(current_rec, index, offsets));
ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table));
ut_ad(!page_zip || page_zip_validate(page_zip, page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
/* The record must not be the supremum or infimum record. */ /* The record must not be the supremum or infimum record. */
ut_ad(page_rec_is_user_rec(current_rec)); ut_ad(page_rec_is_user_rec(current_rec));
......
...@@ -588,7 +588,9 @@ page_copy_rec_list_end( ...@@ -588,7 +588,9 @@ page_copy_rec_list_end(
page_t* page = ut_align_down(rec, UNIV_PAGE_SIZE); page_t* page = ut_align_down(rec, UNIV_PAGE_SIZE);
ulint log_mode= 0; /* remove warning */ ulint log_mode= 0; /* remove warning */
ut_ad(!new_page_zip || page_zip_validate(new_page_zip, new_page)); #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!new_page_zip || page_zip_validate(new_page_zip, new_page));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
ut_ad(page_is_leaf(page) == page_is_leaf(new_page)); ut_ad(page_is_leaf(page) == page_is_leaf(new_page));
ut_ad(page_is_comp(page) == page_is_comp(new_page)); ut_ad(page_is_comp(page) == page_is_comp(new_page));
......
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