diff options
Diffstat (limited to 'storage/xtradb/btr/btr0btr.c')
-rw-r--r-- | storage/xtradb/btr/btr0btr.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/storage/xtradb/btr/btr0btr.c b/storage/xtradb/btr/btr0btr.c index a3e57d632a0..79a8eb9dcc6 100644 --- a/storage/xtradb/btr/btr0btr.c +++ b/storage/xtradb/btr/btr0btr.c @@ -688,7 +688,7 @@ btr_root_fseg_validate( { ulint offset = mach_read_from_2(seg_header + FSEG_HDR_OFFSET); - if (UNIV_UNLIKELY(srv_pass_corrupt_table)) { + if (UNIV_UNLIKELY(srv_pass_corrupt_table != 0)) { return (mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space) && (offset >= FIL_PAGE_DATA) && (offset <= UNIV_PAGE_SIZE - FIL_PAGE_DATA_END); @@ -723,17 +723,14 @@ btr_root_block_get( block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, index, mtr); - if (srv_pass_corrupt_table && !block) { - return(0); - } - ut_a(block); + SRV_CORRUPT_TABLE_CHECK(block, return(0);); btr_assert_not_corrupted(block, index); #ifdef UNIV_BTR_DEBUG if (!dict_index_is_ibuf(index)) { const page_t* root = buf_block_get_frame(block); - if (UNIV_UNLIKELY(srv_pass_corrupt_table)) { + if (UNIV_UNLIKELY(srv_pass_corrupt_table != 0)) { if (!btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF + root, space)) @@ -1063,11 +1060,11 @@ btr_get_size( root = btr_root_get(index, mtr); - if (srv_pass_corrupt_table && !root) { + SRV_CORRUPT_TABLE_CHECK(root, + { mtr_commit(mtr); return(0); - } - ut_a(root); + }); if (flag == BTR_N_LEAF_PAGES) { seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF; @@ -1525,11 +1522,11 @@ leaf_loop: root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, NULL, &mtr); - if (srv_pass_corrupt_table && !root) { + SRV_CORRUPT_TABLE_CHECK(root, + { mtr_commit(&mtr); return; - } - ut_a(root); + }); #ifdef UNIV_BTR_DEBUG ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF @@ -1555,11 +1552,12 @@ top_loop: root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, NULL, &mtr); - if (srv_pass_corrupt_table && !root) { + SRV_CORRUPT_TABLE_CHECK(root, + { mtr_commit(&mtr); return; - } - ut_a(root); + }); + #ifdef UNIV_BTR_DEBUG ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP + root, space)); @@ -1593,10 +1591,7 @@ btr_free_root( block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, NULL, mtr); - if (srv_pass_corrupt_table && !block) { - return; - } - ut_a(block); + SRV_CORRUPT_TABLE_CHECK(block, return;); btr_search_drop_page_hash_index(block); @@ -4565,10 +4560,11 @@ btr_validate_index( root = btr_root_get(index, &mtr); - if (UNIV_UNLIKELY(srv_pass_corrupt_table && !root)) { + SRV_CORRUPT_TABLE_CHECK(root, + { mtr_commit(&mtr); return(FALSE); - } + }); n = btr_page_get_level(root, &mtr); |