This is a question about code internal to the InnoDB storage engine in MySQL 8.0 source.
In the 'ReadView::prepare' method (file read/read0read.c):
m_up_limit_id = !m_ids.empty() ? m_ids.front() : m_low_limit_id;
in the 'changes_visible' method (file include/read0types.h):
if (id < m_up_limit_id || id == m_creator_trx_id) {
return (true);
}
...
if (id >= m_low_limit_id) {
return (false);
} else if (m_ids.empty()) {
return (true);
}
The logic of m_ids.empty()
is useless, id
cannot be less than m_up_limit_id
and greater than or equal to m_low_limit_id
, because m_ids.empty()
, then m_up_limit_id == m_low_limit_id
, I don't know if my understanding is accurate, I hope to get an answer