Commit 5d9f04d4 authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: Replace some is_predefined_tablespace()

In some places, there were redundant comparisons against TRX_SYS_SPACE
or SRV_TMP_SPACE_ID. The temporary tablespace is never the subject of
log-based recovery.
parent 4683c2fe
......@@ -82,7 +82,7 @@ bool fil_space_t::try_to_close(fil_space_t *ignore_space, bool print_info)
case FIL_TYPE_IMPORT:
break;
case FIL_TYPE_TABLESPACE:
if (is_predefined_tablespace(space.id))
if (space.id == TRX_SYS_SPACE || srv_is_undo_tablespace(space.id))
continue;
}
......
......@@ -2184,7 +2184,7 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed)
{
uint32_t space_id= page_id.space();
uint32_t page_no= page_id.page_no();
if (is_predefined_tablespace(space_id))
if (space_id == TRX_SYS_SPACE || srv_is_undo_tablespace(space_id))
{
if (srv_immediate_scrub_data_uncompressed)
fil_space_get(space_id)->free_page(page_no, freed);
......@@ -2714,7 +2714,7 @@ recv_sys_t::parse_mtr_result recv_sys_t::parse(source &l, bool if_exists)
continue;
}
else if (storing == YES && file_checkpoint &&
!is_predefined_tablespace(space_id))
space_id != TRX_SYS_SPACE && !srv_is_undo_tablespace(space_id))
{
recv_spaces_t::iterator i= recv_spaces.lower_bound(space_id);
if (i != recv_spaces.end() && i->first == space_id);
......@@ -3045,7 +3045,7 @@ recv_sys_t::parse_mtr_result recv_sys_t::parse(source &l, bool if_exists)
goto file_rec_error;
}
if (is_predefined_tablespace(space_id))
if (space_id == TRX_SYS_SPACE || srv_is_undo_tablespace(space_id))
goto file_rec_error;
if (fnend - fn < 4 || memcmp(fnend - 4, DOT_IBD, 4))
goto file_rec_error;
......@@ -4299,7 +4299,7 @@ recv_validate_tablespace(bool rescan, bool& missing_tablespace)
p != recv_sys.pages.end();) {
ut_ad(!p->second.log.empty());
const uint32_t space = p->first.space();
if (is_predefined_tablespace(space)) {
if (space == TRX_SYS_SPACE || srv_is_undo_tablespace(space)) {
next:
p++;
continue;
......
......@@ -1187,7 +1187,7 @@ std::pair<lsn_t,mtr_t::page_flush_ahead> mtr_t::do_write()
log_sys.latch.rd_lock(SRW_LOCK_CALL);
if (UNIV_UNLIKELY(m_user_space && !m_user_space->max_lsn &&
!is_predefined_tablespace(m_user_space->id)))
!srv_is_undo_tablespace((m_user_space->id))))
{
if (!m_latch_ex)
{
......
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