diff options
Diffstat (limited to 'storage/xtradb/page/page0cur.c')
-rw-r--r-- | storage/xtradb/page/page0cur.c | 78 |
1 files changed, 10 insertions, 68 deletions
diff --git a/storage/xtradb/page/page0cur.c b/storage/xtradb/page/page0cur.c index fa3d2532deb..936762b986a 100644 --- a/storage/xtradb/page/page0cur.c +++ b/storage/xtradb/page/page0cur.c @@ -564,74 +564,6 @@ page_cur_open_on_rnd_user_rec( } while (rnd--); } -UNIV_INTERN -void -page_cur_open_on_nth_user_rec( -/*==========================*/ - buf_block_t* block, /*!< in: page */ - page_cur_t* cursor, /*!< out: page cursor */ - ulint nth) -{ - ulint n_recs = page_get_n_recs(buf_block_get_frame(block)); - - page_cur_set_before_first(block, cursor); - - if (UNIV_UNLIKELY(n_recs == 0)) { - - return; - } - - nth--; - - if (nth >= n_recs) { - nth = n_recs - 1; - } - - do { - page_cur_move_to_next(cursor); - } while (nth--); -} - -UNIV_INTERN -ibool -page_cur_open_on_rnd_user_rec_after_nth( -/*==========================*/ - buf_block_t* block, /*!< in: page */ - page_cur_t* cursor, /*!< out: page cursor */ - ulint nth) -{ - ulint rnd; - ulint n_recs = page_get_n_recs(buf_block_get_frame(block)); - ibool ret; - - page_cur_set_before_first(block, cursor); - - if (UNIV_UNLIKELY(n_recs == 0)) { - - return (FALSE); - } - - nth--; - - if (nth >= n_recs) { - nth = n_recs - 1; - } - - rnd = (ulint) (nth + page_cur_lcg_prng() % (n_recs - nth)); - - if (rnd == nth) { - ret = TRUE; - } else { - ret = FALSE; - } - - do { - page_cur_move_to_next(cursor); - } while (rnd--); - - return (ret); -} - /***********************************************************//** Writes the log record of a record insert on a page. */ static @@ -1217,6 +1149,8 @@ use_heap: current_rec, index, mtr); } + btr_blob_dbg_add_rec(insert_rec, index, offsets, "insert"); + return(insert_rec); } @@ -1263,10 +1197,12 @@ page_cur_insert_rec_zip_reorg( } /* Out of space: restore the page */ + btr_blob_dbg_remove(page, index, "insert_zip_fail"); if (!page_zip_decompress(page_zip, page, FALSE)) { ut_error; /* Memory corrupted? */ } ut_ad(page_validate(page, index)); + btr_blob_dbg_add(page, index, "insert_zip_fail"); return(NULL); } @@ -1558,6 +1494,8 @@ use_heap: page_zip_write_rec(page_zip, insert_rec, index, offsets, 1); + btr_blob_dbg_add_rec(insert_rec, index, offsets, "insert_zip_ok"); + /* 9. Write log record of the insert */ if (UNIV_LIKELY(mtr != NULL)) { page_cur_insert_rec_write_log(insert_rec, rec_size, @@ -1765,6 +1703,9 @@ page_copy_rec_list_end_to_created_page( heap_top += rec_size; + rec_offs_make_valid(insert_rec, index, offsets); + btr_blob_dbg_add_rec(insert_rec, index, offsets, "copy_end"); + page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec, index, mtr); prev_rec = insert_rec; @@ -2012,6 +1953,7 @@ page_cur_delete_rec( page_dir_slot_set_n_owned(cur_dir_slot, page_zip, cur_n_owned - 1); /* 6. Free the memory occupied by the record */ + btr_blob_dbg_remove_rec(current_rec, index, offsets, "delete"); page_mem_free(page, page_zip, current_rec, index, offsets); /* 7. Now we have decremented the number of owned records of the slot. |