diff --git a/mysql-8.0.19/storage/innobase/btr/btr0btr.cc b/mysql-8.0.19/storage/innobase/btr/btr0btr.cc index ce885894b..22c42fb66 100644 --- a/mysql-8.0.19/storage/innobase/btr/btr0btr.cc +++ b/mysql-8.0.19/storage/innobase/btr/btr0btr.cc @@ -3823,27 +3823,26 @@ static void btr_print_recursive( page_cur_set_before_first(block, &cursor); page_cur_move_to_next(&cursor); - while (!page_cur_is_after_last(&cursor)) { - if (page_is_leaf(page)) { - /* If this is the leaf level, do nothing */ + if (!page_is_leaf(page)) { + while (!page_cur_is_after_last(&cursor)) { + if ((i <= width) || (i >= n_recs - width)) { + const rec_t *node_ptr; - } else if ((i <= width) || (i >= n_recs - width)) { - const rec_t *node_ptr; + mtr_start(&mtr2); - mtr_start(&mtr2); + node_ptr = page_cur_get_rec(&cursor); - node_ptr = page_cur_get_rec(&cursor); + *offsets = + rec_get_offsets(node_ptr, index, *offsets, ULINT_UNDEFINED, heap); + btr_print_recursive( + index, btr_node_ptr_get_child(node_ptr, index, *offsets, &mtr2), + width, heap, offsets, &mtr2); + mtr_commit(&mtr2); + } - *offsets = - rec_get_offsets(node_ptr, index, *offsets, ULINT_UNDEFINED, heap); - btr_print_recursive( - index, btr_node_ptr_get_child(node_ptr, index, *offsets, &mtr2), - width, heap, offsets, &mtr2); - mtr_commit(&mtr2); + page_cur_move_to_next(&cursor); + i++; } - - page_cur_move_to_next(&cursor); - i++; } }