|
There is no need to commit mtr in the following code:
dberr_t
|
row_search_mvcc(...)
|
{
|
...
|
} else if (mtr_has_extra_clust_latch) {
|
/* If we have extra cluster latch, we must commit
|
|
mtr if we are moving to the next non-clustered
|
index record, because we could break the latching
|
order if we would access a different clustered
|
index page right away without releasing the previous. */
|
|
btr_pcur_store_position(pcur, &mtr);
|
mtr.commit();
|
mtr_has_extra_clust_latch = FALSE;
|
|
mtr.start();
|
|
if (sel_restore_position_for_mysql(&same_user_rec,
|
BTR_SEARCH_LEAF,
|
pcur, moves_up, &mtr)) {
|
goto rec_loop;
|
}
|
}
|
|
...
|
}
|
We could create mtr savepoint before requesting clustered index record(mtr_t::get_savepoint()), then release only clustered index page latches(mtr_t::release_s_latch_at_savepoint()) instead of mtr committing.
|