MySQL 8.0.40
Source Code Documentation
|
Row versions. More...
#include "data0data.h"
#include "dict0mem.h"
#include "dict0types.h"
#include "lob0undo.h"
#include "mtr0mtr.h"
#include "que0types.h"
#include "rem0types.h"
#include "trx0types.h"
#include "univ.i"
#include "row0vers.ic"
Go to the source code of this file.
Functions | |
trx_t * | row_vers_impl_x_locked (const rec_t *rec, const dict_index_t *index, const ulint *offsets) |
Finds out if an active transaction has inserted or modified a secondary index record. More... | |
bool | row_vers_must_preserve_del_marked (trx_id_t trx_id, const table_name_t &name, mtr_t *mtr) |
Finds out if we must preserve a delete marked earlier version of a clustered index record, because it is >= the purge view. More... | |
bool | row_vers_old_has_index_entry (bool also_curr, const rec_t *rec, mtr_t *mtr, dict_index_t *index, const dtuple_t *ientry, roll_ptr_t roll_ptr, trx_id_t trx_id) |
Finds out if a version of the record, where the version >= the current purge view, should have ientry as its secondary index entry. More... | |
dberr_t | row_vers_build_for_consistent_read (const rec_t *rec, mtr_t *mtr, dict_index_t *index, ulint **offsets, ReadView *view, mem_heap_t **offset_heap, mem_heap_t *in_heap, rec_t **old_vers, const dtuple_t **vrow, lob::undo_vers_t *lob_undo) |
Constructs the version of a clustered index record which a consistent read should see. More... | |
void | row_vers_build_for_semi_consistent_read (const rec_t *rec, mtr_t *mtr, dict_index_t *index, ulint **offsets, mem_heap_t **offset_heap, mem_heap_t *in_heap, const rec_t **old_vers, const dtuple_t **vrow) |
Constructs the last committed version of a clustered index record, which should be seen by a semi-consistent read. More... | |
Row versions.
Created 2/6/1997 Heikki Tuuri
dberr_t row_vers_build_for_consistent_read | ( | const rec_t * | rec, |
mtr_t * | mtr, | ||
dict_index_t * | index, | ||
ulint ** | offsets, | ||
ReadView * | view, | ||
mem_heap_t ** | offset_heap, | ||
mem_heap_t * | in_heap, | ||
rec_t ** | old_vers, | ||
const dtuple_t ** | vrow, | ||
lob::undo_vers_t * | lob_undo | ||
) |
Constructs the version of a clustered index record which a consistent read should see.
We assume that the trx id stored in rec is such that the consistent read should not see rec in its present version.
[in] | rec | record in a clustered index; the caller must have a latch on the page; this latch locks the top of the stack of versions of this records |
[in] | mtr | mtr holding the latch on rec; it will also hold the latch on purge_view |
[in] | index | the clustered index |
[in] | offsets | offsets returned by rec_get_offsets(rec, index) |
[in] | view | the consistent read view |
[in,out] | offset_heap | memory heap from which the offsets are allocated |
[in] | in_heap | memory heap from which the memory for *old_vers is allocated; memory for possible intermediate versions is allocated and freed locally within the function |
[out] | old_vers | old version, or NULL if the history is missing or the record does not exist in the view, that is, it was freshly inserted afterwards. |
[out] | vrow | reports virtual column info if any |
[in] | lob_undo | undo log to be applied to blobs. |
void row_vers_build_for_semi_consistent_read | ( | const rec_t * | rec, |
mtr_t * | mtr, | ||
dict_index_t * | index, | ||
ulint ** | offsets, | ||
mem_heap_t ** | offset_heap, | ||
mem_heap_t * | in_heap, | ||
const rec_t ** | old_vers, | ||
const dtuple_t ** | vrow | ||
) |
Constructs the last committed version of a clustered index record, which should be seen by a semi-consistent read.
[in] | rec | Record in a clustered index; the caller must have a latch on the page; this latch locks the top of the stack of versions of this records |
[in] | mtr | Mini-transaction holding the latch on rec |
[in] | index | The clustered index |
[in,out] | offsets | Offsets returned by rec_get_offsets(rec, index) |
[in,out] | offset_heap | Memory heap from which the offsets are allocated |
[in] | in_heap | Memory heap from which the memory for *old_vers is allocated; memory for possible intermediate versions is allocated and freed locally within the function |
[out] | old_vers | Rec, old version, or null if the record does not exist in the view, that is, it was freshly inserted afterwards |
[out] | vrow | Virtual row, old version, or null if it is not updated in the view |
trx_t * row_vers_impl_x_locked | ( | const rec_t * | rec, |
const dict_index_t * | index, | ||
const ulint * | offsets | ||
) |
Finds out if an active transaction has inserted or modified a secondary index record.
[in] | rec | record in a secondary index |
[in] | index | the secondary index |
[in] | offsets | rec_get_offsets(rec, index) |
bool row_vers_must_preserve_del_marked | ( | trx_id_t | trx_id, |
const table_name_t & | name, | ||
mtr_t * | mtr | ||
) |
Finds out if we must preserve a delete marked earlier version of a clustered index record, because it is >= the purge view.
[in] | trx_id | Transaction id in the version |
[in] | name | Table name |
[in,out] | mtr | Mini-transaction holding the latch on the clustered index record; it will also hold the latch on purge_view |
bool row_vers_old_has_index_entry | ( | bool | also_curr, |
const rec_t * | rec, | ||
mtr_t * | mtr, | ||
dict_index_t * | index, | ||
const dtuple_t * | ientry, | ||
roll_ptr_t | roll_ptr, | ||
trx_id_t | trx_id | ||
) |
Finds out if a version of the record, where the version >= the current purge view, should have ientry as its secondary index entry.
We check if there is any not delete marked version of the record where the trx id >= purge view, and the secondary index entry == ientry; exactly in this case we return true.
We check if there is any not delete marked version of the record where the trx id >= purge view, and the secondary index entry and ientry are identified in the alphabetical ordering; exactly in this case we return true.
also_curr | in: true if also rec is included in the versions to search; otherwise only versions prior to it are searched |
rec | in: record in the clustered index; the caller must have a latch on the page |
mtr | in: mtr holding the latch on rec; it will also hold the latch on purge_view |
index | in: the secondary index |
ientry | in: the secondary index entry |
roll_ptr | in: roll_ptr for the purge record |
trx_id | in: transaction ID on the purging record |