diff --git a/mysql-8.0.19/storage/innobase/include/trx0undo.h b/mysql-8.0.19/storage/innobase/include/trx0undo.h index ad42905fb..df5ed9018 100644 --- a/mysql-8.0.19/storage/innobase/include/trx0undo.h +++ b/mysql-8.0.19/storage/innobase/include/trx0undo.h @@ -145,6 +145,12 @@ trx_undo_rec_t *trx_undo_get_next_rec( ulint offset, /*!< in: undo log header offset on page */ mtr_t *mtr); /*!< in: mtr */ +/** Gets the next record in an undo log from the next page. +@return undo log record, the page latched, NULL if none */ +trx_undo_rec_t *trx_undo_get_next_rec_from_next_page( + space_id_t space, const page_size_t &page_size, const page_t *undo_page, + page_no_t page_no, ulint offset, ulint mode, mtr_t *mtr) + /** Gets the first record in an undo log. @param[out] modifier_trx_id the modifier trx identifier. @param[in] space undo log header space diff --git a/mysql-8.0.19/storage/innobase/trx/trx0purge.cc b/mysql-8.0.19/storage/innobase/trx/trx0purge.cc index 76d120885..fc8b206fe 100644 --- a/mysql-8.0.19/storage/innobase/trx/trx0purge.cc +++ b/mysql-8.0.19/storage/innobase/trx/trx0purge.cc @@ -1883,8 +1883,9 @@ static trx_undo_rec_t *trx_purge_get_next_rec( purge_sys->hdr_offset); if (next_rec == NULL) { - rec2 = trx_undo_get_next_rec(rec2, purge_sys->hdr_page_no, - purge_sys->hdr_offset, &mtr); + rec2 = trx_undo_get_next_rec_from_next_page( + purge_sys->rseg->space_id, page_size, page_align(rec2), + purge_sys->hdr_page_no, purge_sys->hdr_offset, RW_S_LATCH, &mtr); break; } diff --git a/mysql-8.0.19/storage/innobase/trx/trx0undo.cc b/mysql-8.0.19/storage/innobase/trx/trx0undo.cc index 5c46ae1f9..7258bcb0e 100644 --- a/mysql-8.0.19/storage/innobase/trx/trx0undo.cc +++ b/mysql-8.0.19/storage/innobase/trx/trx0undo.cc @@ -216,7 +216,7 @@ trx_undo_rec_t *trx_undo_get_prev_rec( @param[in] mode latch mode: RW_S_LATCH or RW_X_LATCH @param[in,out] mtr mini-transaction @return undo log record, the page latched, NULL if none */ -static trx_undo_rec_t *trx_undo_get_next_rec_from_next_page( +trx_undo_rec_t *trx_undo_get_next_rec_from_next_page( space_id_t space, const page_size_t &page_size, const page_t *undo_page, page_no_t page_no, ulint offset, ulint mode, mtr_t *mtr) { const trx_ulogf_t *log_hdr;