• Marko Mäkelä's avatar
    MDEV-29603 btr_cur_open_at_index_side() is missing some consistency checks · 24fe5347
    Marko Mäkelä authored
    btr_cur_t: Zero-initialize all fields in the default constructor.
    
    btr_cur_t::index: Remove; it duplicated page_cur.index.
    
    Many functions: Remove arguments that were duplicating
    page_cur_t::index and page_cur_t::block.
    
    page_cur_open_level(), btr_pcur_open_level(): Replaces
    btr_cur_open_at_index_side() for dict_stats_analyze_index().
    At the end, release all latches except the dict_index_t::lock
    and the buf_page_t::lock on the requested page.
    
    dict_stats_analyze_index(): Rely on mtr_t::rollback_to_savepoint()
    to release all uninteresting page latches.
    
    btr_search_guess_on_hash(): Simplify the logic, and invoke
    mtr_t::rollback_to_savepoint().
    
    We will use plain C++ std::vector<mtr_memo_slot_t> for mtr_t::m_memo.
    In this way, we can avoid setting mtr_memo_slot_t::object to nullptr
    and instead just remove garbage from m_memo.
    
    mtr_t::rollback_to_savepoint(): Shrink the vector. We will be needing this
    in dict_stats_analyze_index(), where we will release page latches and
    only retain the index->lock in mtr_t::m_memo.
    
    mtr_t::release_last_page(): Release the last acquired page latch.
    Replaces btr_leaf_page_release().
    
    mtr_t::release(const buf_block_t&): Release a single page latch.
    Used in btr_pcur_move_backward_from_page().
    
    mtr_t::memo_release(): Replaced with mtr_t::release().
    
    mtr_t::upgrade_buffer_fix(): Acquire a latch for a buffer-fixed page.
    This replaces the double bookkeeping in btr_cur_t::open_leaf().
    
    Reviewed by: Vladislav Lesin
    24fe5347
trx0trx.cc 58.6 KB