Commit 737b7017 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12353: Remove trx_undo_erase_page_end()

MariaDB stopped writing the record MLOG_UNDO_ERASE_END
in commit 0fd3def2 (10.3.3).
Merge trx_undo_erase_page_end() with its callers.
parent 07d39cde
......@@ -251,11 +251,6 @@ trx_undo_parse_add_undo_rec(
const byte* ptr,
const byte* end_ptr,
page_t* page);
/** Erase the unused undo log page end.
@param[in,out] undo_page undo log page
@return whether the page contained something */
bool
trx_undo_erase_page_end(page_t* undo_page);
/** Read from an undo log record a non-virtual column value.
@param[in,out] ptr pointer to remaining part of the undo record
......
......@@ -1680,7 +1680,11 @@ recv_parse_or_apply_log_rec_body(
case MLOG_UNDO_ERASE_END:
if (page) {
ut_ad(page_type == FIL_PAGE_UNDO_LOG);
trx_undo_erase_page_end(page);
uint16_t first_free = mach_read_from_2(
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE + page);
memset(page + first_free, 0,
(srv_page_size - FIL_PAGE_DATA_END)
- first_free);
}
break;
case MLOG_UNDO_INIT:
......
......@@ -1917,22 +1917,6 @@ trx_undo_rec_get_partial_row(
return(const_cast<byte*>(ptr));
}
/** Erase the unused undo log page end.
@param[in,out] undo_page undo log page
@return whether the page contained something */
bool
trx_undo_erase_page_end(page_t* undo_page)
{
ulint first_free;
first_free = mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
+ TRX_UNDO_PAGE_FREE);
memset(undo_page + first_free, 0,
(srv_page_size - FIL_PAGE_DATA_END) - first_free);
return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
}
/** Report a RENAME TABLE operation.
@param[in,out] trx transaction
@param[in] table table that is being renamed
......@@ -2114,7 +2098,15 @@ trx_undo_report_row_operation(
cmpl_info, clust_entry, &mtr);
if (UNIV_UNLIKELY(offset == 0)) {
if (!trx_undo_erase_page_end(undo_block->frame)) {
const uint16_t first_free = mach_read_from_2(
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE
+ undo_block->frame);
memset(undo_block->frame + first_free, 0,
(srv_page_size - FIL_PAGE_DATA_END)
- first_free);
if (first_free
== TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE) {
/* The record did not fit on an empty
undo page. Discard the freshly allocated
page and return an error. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment