Commit ccb35502 authored by Marko Mäkelä's avatar Marko Mäkelä

Replace MLOG_UNDO_INIT with MLOG_2BYTES, MLOG_4BYTES

parent 3464b670
...@@ -106,9 +106,6 @@ enum mlog_id_t { ...@@ -106,9 +106,6 @@ enum mlog_id_t {
/** erase an undo log page end */ /** erase an undo log page end */
MLOG_UNDO_ERASE_END = 21, MLOG_UNDO_ERASE_END = 21,
/** initialize a page in an undo log */
MLOG_UNDO_INIT = 22,
/** create an undo log header */ /** create an undo log header */
MLOG_UNDO_HDR_CREATE = 25, MLOG_UNDO_HDR_CREATE = 25,
......
...@@ -315,16 +315,6 @@ bool ...@@ -315,16 +315,6 @@ bool
trx_undo_truncate_tablespace( trx_undo_truncate_tablespace(
undo::Truncate* undo_trunc); undo::Truncate* undo_trunc);
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
@return end of log record or NULL */
byte*
trx_undo_parse_page_init(
/*=====================*/
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr); /*!< in: mtr or NULL */
/** Parse the redo log entry of an undo log page header create. /** Parse the redo log entry of an undo log page header create.
@param[in] ptr redo log record @param[in] ptr redo log record
@param[in] end_ptr end of log buffer @param[in] end_ptr end of log buffer
......
...@@ -1402,10 +1402,6 @@ recv_parse_or_apply_log_rec_body( ...@@ -1402,10 +1402,6 @@ recv_parse_or_apply_log_rec_body(
ut_ad(!page || page_type == FIL_PAGE_UNDO_LOG); ut_ad(!page || page_type == FIL_PAGE_UNDO_LOG);
ptr = trx_undo_parse_erase_page_end(ptr, end_ptr, page, mtr); ptr = trx_undo_parse_erase_page_end(ptr, end_ptr, page, mtr);
break; break;
case MLOG_UNDO_INIT:
/* Allow anything in page_type when creating a page. */
ptr = trx_undo_parse_page_init(ptr, end_ptr, page, mtr);
break;
case MLOG_UNDO_HDR_CREATE: case MLOG_UNDO_HDR_CREATE:
ut_ad(!page || page_type == FIL_PAGE_UNDO_LOG); ut_ad(!page || page_type == FIL_PAGE_UNDO_LOG);
ptr = trx_undo_parse_page_header(ptr, end_ptr, page, mtr); ptr = trx_undo_parse_page_header(ptr, end_ptr, page, mtr);
...@@ -3636,9 +3632,6 @@ get_mlog_string(mlog_id_t type) ...@@ -3636,9 +3632,6 @@ get_mlog_string(mlog_id_t type)
case MLOG_UNDO_ERASE_END: case MLOG_UNDO_ERASE_END:
return("MLOG_UNDO_ERASE_END"); return("MLOG_UNDO_ERASE_END");
case MLOG_UNDO_INIT:
return("MLOG_UNDO_INIT");
case MLOG_UNDO_HDR_CREATE: case MLOG_UNDO_HDR_CREATE:
return("MLOG_UNDO_HDR_CREATE"); return("MLOG_UNDO_HDR_CREATE");
......
...@@ -309,47 +309,6 @@ trx_undo_get_first_rec( ...@@ -309,47 +309,6 @@ trx_undo_get_first_rec(
/*============== UNDO LOG FILE COPY CREATION AND FREEING ==================*/ /*============== UNDO LOG FILE COPY CREATION AND FREEING ==================*/
/**********************************************************************//**
Writes the mtr log entry of an undo log page initialization. */
UNIV_INLINE
void
trx_undo_page_init_log(
/*===================*/
page_t* undo_page, /*!< in: undo log page */
mtr_t* mtr) /*!< in: mtr */
{
mlog_write_initial_log_record(undo_page, MLOG_UNDO_INIT, mtr);
mlog_catenate_ulint_compressed(mtr, 0);
}
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
@return end of log record or NULL */
byte*
trx_undo_parse_page_init(
/*=====================*/
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
if (mach_parse_compressed(&ptr, end_ptr)) {
recv_sys->found_corrupt_log = true;
}
if (ptr == NULL) {
return(NULL);
}
if (page) {
trx_undo_page_init(page, mtr);
}
return(const_cast<byte*>(ptr));
}
/********************************************************************//** /********************************************************************//**
Initializes the fields in an undo log segment page. */ Initializes the fields in an undo log segment page. */
static static
...@@ -361,18 +320,18 @@ trx_undo_page_init( ...@@ -361,18 +320,18 @@ trx_undo_page_init(
{ {
trx_upagef_t* page_hdr; trx_upagef_t* page_hdr;
page_hdr = undo_page + TRX_UNDO_PAGE_HDR; mlog_write_ulint(undo_page + FIL_PAGE_TYPE,
FIL_PAGE_UNDO_LOG, MLOG_2BYTES, mtr);
compile_time_assert(TRX_UNDO_PAGE_TYPE == 0);
compile_time_assert(TRX_UNDO_PAGE_START == 2);
compile_time_assert(TRX_UNDO_PAGE_NODE == TRX_UNDO_PAGE_FREE + 2);
*reinterpret_cast<uint16*>(page_hdr + TRX_UNDO_PAGE_TYPE) = 0; page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
mlog_write_ulint(page_hdr, TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE,
mach_write_to_2(page_hdr + TRX_UNDO_PAGE_START, MLOG_4BYTES, mtr);
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE,
mach_write_to_2(page_hdr + TRX_UNDO_PAGE_FREE, TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE,
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); MLOG_2BYTES, mtr);
fil_page_set_type(undo_page, FIL_PAGE_UNDO_LOG);
trx_undo_page_init_log(undo_page, mtr);
} }
/***************************************************************//** /***************************************************************//**
......
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