InnoDB Plugin
1.0
|
#include "univ.i"
#include "trx0types.h"
#include "row0types.h"
#include "mtr0mtr.h"
#include "dict0types.h"
#include "data0data.h"
#include "rem0types.h"
#include "que0types.h"
#include "trx0rec.ic"
Go to the source code of this file.
Macros | |
#define | trx_undo_rec_get_ptr(undo_rec, undo_no) ((undo_rec) + trx_undo_rec_get_offset(undo_no)) |
#define | TRX_UNDO_INSERT_REC 11 /* fresh insert into clustered index */ |
#define | TRX_UNDO_UPD_EXIST_REC |
#define | TRX_UNDO_UPD_DEL_REC |
#define | TRX_UNDO_DEL_MARK_REC |
#define | TRX_UNDO_CMPL_INFO_MULT |
#define | TRX_UNDO_UPD_EXTERN |
#define | TRX_UNDO_INSERT_OP 1 |
#define | TRX_UNDO_MODIFY_OP 2 |
Functions | |
UNIV_INLINE trx_undo_rec_t * | trx_undo_rec_copy (const trx_undo_rec_t *undo_rec, mem_heap_t *heap) |
UNIV_INLINE ulint | trx_undo_rec_get_type (const trx_undo_rec_t *undo_rec) |
UNIV_INLINE ulint | trx_undo_rec_get_cmpl_info (const trx_undo_rec_t *undo_rec) |
UNIV_INLINE ibool | trx_undo_rec_get_extern_storage (const trx_undo_rec_t *undo_rec) |
UNIV_INLINE undo_no_t | trx_undo_rec_get_undo_no (const trx_undo_rec_t *undo_rec) |
UNIV_INLINE ulint | trx_undo_rec_get_offset (undo_no_t undo_no)) |
UNIV_INTERN byte * | trx_undo_rec_get_pars (trx_undo_rec_t *undo_rec, ulint *type, ulint *cmpl_info, bool *updated_extern, undo_no_t *undo_no, table_id_t *table_id)) |
UNIV_INTERN byte * | trx_undo_rec_get_row_ref (byte *ptr, dict_index_t *index, dtuple_t **ref, mem_heap_t *heap) |
UNIV_INTERN byte * | trx_undo_rec_skip_row_ref (byte *ptr, dict_index_t *index) |
UNIV_INTERN byte * | trx_undo_update_rec_get_sys_cols (byte *ptr, trx_id_t *trx_id, roll_ptr_t *roll_ptr, ulint *info_bits) |
UNIV_INTERN byte * | trx_undo_update_rec_get_update (byte *ptr, dict_index_t *index, ulint type, trx_id_t trx_id, roll_ptr_t roll_ptr, ulint info_bits, trx_t *trx, mem_heap_t *heap, upd_t **upd) |
UNIV_INTERN byte * | trx_undo_rec_get_partial_row (byte *ptr, dict_index_t *index, dtuple_t **row, ibool ignore_prefix, mem_heap_t *heap)) |
UNIV_INTERN dberr_t | trx_undo_report_row_operation (ulint flags, ulint op_type, que_thr_t *thr, dict_index_t *index, const dtuple_t *clust_entry, const upd_t *update, ulint cmpl_info, const rec_t *rec, const ulint *offsets, roll_ptr_t *roll_ptr) |
UNIV_INTERN trx_undo_rec_t * | trx_undo_get_undo_rec_low (roll_ptr_t roll_ptr, mem_heap_t *heap)) |
UNIV_INTERN bool | trx_undo_prev_version_build (const rec_t *index_rec, mtr_t *index_mtr, const rec_t *rec, dict_index_t *index, ulint *offsets, mem_heap_t *heap, rec_t **old_vers)) |
UNIV_INTERN byte * | trx_undo_parse_add_undo_rec (byte *ptr, byte *end_ptr, page_t *page) |
UNIV_INTERN byte * | trx_undo_parse_erase_page_end (byte *ptr, byte *end_ptr, page_t *page, mtr_t *mtr) |
Variables | |
UNIV_INTERN dberr_t | warn_unused_result |
Transaction undo log record
Created 3/26/1996 Heikki Tuuri
#define TRX_UNDO_CMPL_INFO_MULT |
#define TRX_UNDO_DEL_MARK_REC |
#define trx_undo_rec_get_ptr | ( | undo_rec, | |
undo_no | |||
) | ((undo_rec) + trx_undo_rec_get_offset(undo_no)) |
Returns the start of the undo record data area.
#define TRX_UNDO_UPD_DEL_REC |
#define TRX_UNDO_UPD_EXIST_REC |
#define TRX_UNDO_UPD_EXTERN |
UNIV_INTERN trx_undo_rec_t* trx_undo_get_undo_rec_low | ( | roll_ptr_t | roll_ptr, |
mem_heap_t * | heap | ||
) |
Copies an undo record to heap. This function can be called if we know that the undo log record exists.
roll_ptr | in: roll pointer to record |
heap | in: memory heap where copied |
UNIV_INTERN byte* trx_undo_parse_add_undo_rec | ( | byte * | ptr, |
byte * | end_ptr, | ||
page_t * | page | ||
) |
Parses a redo log record of adding an undo log record.
ptr | in: buffer |
end_ptr | in: buffer end |
UNIV_INTERN byte* trx_undo_parse_erase_page_end | ( | byte * | ptr, |
byte * | end_ptr, | ||
page_t * | page, | ||
mtr_t * | mtr | ||
) |
Parses a redo log record of erasing of an undo page end.
ptr | in: buffer |
end_ptr | in: buffer end |
page | in: page or NULL |
UNIV_INTERN bool trx_undo_prev_version_build | ( | const rec_t * | index_rec, |
mtr_t * | index_mtr, | ||
const rec_t * | rec, | ||
dict_index_t * | index, | ||
ulint * | offsets, | ||
mem_heap_t * | heap, | ||
rec_t ** | old_vers | ||
) |
Build a previous version of a clustered index record. The caller must hold a latch on the index page of the clustered index record.
true | if previous version was built, or if it was an insert or the table has been rebuilt |
false | if the previous version is earlier than purge_view, which means that it may have been removed |
index_rec | in: clustered index record in the index tree |
index_mtr | in: mtr which contains the latch to index_rec page and purge_view |
rec | in: version of a clustered index record |
index | in: clustered index |
offsets | in/out: rec_get_offsets(rec, index) |
heap | in: memory heap from which the memory needed is allocated |
old_vers | out, own: previous version, or NULL if rec is the first inserted version, or if history data has been deleted |
UNIV_INLINE trx_undo_rec_t* trx_undo_rec_copy | ( | const trx_undo_rec_t * | undo_rec, |
mem_heap_t * | heap | ||
) |
Copies the undo record to the heap.
Copies the undo record to the heap.
undo_rec | in: undo log record |
heap | in: heap where copied |
UNIV_INLINE ulint trx_undo_rec_get_cmpl_info | ( | const trx_undo_rec_t * | undo_rec | ) |
Reads from an undo log record the record compiler info.
Reads from an undo log record the record compiler info.
undo_rec | in: undo log record |
UNIV_INLINE ibool trx_undo_rec_get_extern_storage | ( | const trx_undo_rec_t * | undo_rec | ) |
Returns TRUE if an undo log record contains an extern storage field.
Returns TRUE if an undo log record contains an extern storage field.
undo_rec | in: undo log record |
UNIV_INLINE ulint trx_undo_rec_get_offset | ( | undo_no_t | undo_no | ) |
Returns the start of the undo record data area.
undo_no | in: undo no read from node |
UNIV_INTERN byte* trx_undo_rec_get_pars | ( | trx_undo_rec_t * | undo_rec, |
ulint * | type, | ||
ulint * | cmpl_info, | ||
bool * | updated_extern, | ||
undo_no_t * | undo_no, | ||
table_id_t * | table_id | ||
) |
Reads from an undo log record the general parameters.
undo_rec | in: undo log record |
type | out: undo record type: TRX_UNDO_INSERT_REC, ... |
cmpl_info | out: compiler info, relevant only for update type records |
updated_extern | out: true if we updated an externally stored fild |
undo_no | out: undo log record number |
table_id | out: table id |
UNIV_INTERN byte* trx_undo_rec_get_partial_row | ( | byte * | ptr, |
dict_index_t * | index, | ||
dtuple_t ** | row, | ||
ibool | ignore_prefix, | ||
mem_heap_t * | heap | ||
) |
Builds a partial row from an update undo log record, for purge. It contains the columns which occur as ordering in any index of the table. Any missing columns are indicated by col->mtype == DATA_MISSING.
ptr | in: remaining part in update undo log record of a suitable type, at the start of the stored index columns; NOTE that this copy of the undo log record must be preserved as long as the partial row is used, as we do NOT copy the data in the record! |
index | in: clustered index |
row | out, own: partial row |
ignore_prefix | in: flag to indicate if we expect blob prefixes in undo. Used only in the assertion. |
heap | in: memory heap from which the memory needed is allocated |
UNIV_INTERN byte* trx_undo_rec_get_row_ref | ( | byte * | ptr, |
dict_index_t * | index, | ||
dtuple_t ** | ref, | ||
mem_heap_t * | heap | ||
) |
Builds a row reference from an undo log record.
ptr | in: remaining part of a copy of an undo log record, at the start of the row reference; NOTE that this copy of the undo log record must be preserved as long as the row reference is used, as we do NOT copy the data in the record! |
index | in: clustered index |
ref | out, own: row reference |
UNIV_INLINE ulint trx_undo_rec_get_type | ( | const trx_undo_rec_t * | undo_rec | ) |
Reads the undo log record type.
Reads from an undo log record the record type.
undo_rec | in: undo log record |
UNIV_INLINE undo_no_t trx_undo_rec_get_undo_no | ( | const trx_undo_rec_t * | undo_rec | ) |
Reads the undo log record number.
Reads the undo log record number.
undo_rec | in: undo log record |
UNIV_INTERN byte* trx_undo_rec_skip_row_ref | ( | byte * | ptr, |
dict_index_t * | index | ||
) |
Skips a row reference from an undo log record.
ptr | in: remaining part in update undo log record, at the start of the row reference |
UNIV_INTERN dberr_t trx_undo_report_row_operation | ( | ulint | flags, |
ulint | op_type, | ||
que_thr_t * | thr, | ||
dict_index_t * | index, | ||
const dtuple_t * | clust_entry, | ||
const upd_t * | update, | ||
ulint | cmpl_info, | ||
const rec_t * | rec, | ||
const ulint * | offsets, | ||
roll_ptr_t * | roll_ptr | ||
) |
Writes information to an undo log about an insert, update, or a delete marking of a clustered index record. This information is used in a rollback of the transaction and in consistent reads that must look to the history of this transaction.
flags | in: if BTR_NO_UNDO_LOG_FLAG bit is set, does nothing |
op_type | in: TRX_UNDO_INSERT_OP or TRX_UNDO_MODIFY_OP |
thr | in: query thread |
index | in: clustered index |
clust_entry | in: in the case of an insert, index entry to insert into the clustered index, otherwise NULL |
update | in: in the case of an update, the update vector, otherwise NULL |
cmpl_info | in: compiler info on secondary index updates |
rec | in: case of an update or delete marking, the record in the clustered index, otherwise NULL |
offsets | in: rec_get_offsets(rec) |
roll_ptr | out: rollback pointer to the inserted undo log record, 0 if BTR_NO_UNDO_LOG flag was specified |
UNIV_INTERN byte* trx_undo_update_rec_get_sys_cols | ( | byte * | ptr, |
trx_id_t * | trx_id, | ||
roll_ptr_t * | roll_ptr, | ||
ulint * | info_bits | ||
) |
Reads from an undo log update record the system field values of the old version.
ptr | in: remaining part of undo log record after reading general parameters |
trx_id | out: trx id |
roll_ptr | out: roll ptr |
UNIV_INTERN byte* trx_undo_update_rec_get_update | ( | byte * | ptr, |
dict_index_t * | index, | ||
ulint | type, | ||
trx_id_t | trx_id, | ||
roll_ptr_t | roll_ptr, | ||
ulint | info_bits, | ||
trx_t * | trx, | ||
mem_heap_t * | heap, | ||
upd_t ** | upd | ||
) |
Builds an update vector based on a remaining part of an undo log record.
ptr | in: remaining part in update undo log record, after reading the row reference NOTE that this copy of the undo log record must be preserved as long as the update vector is used, as we do NOT copy the data in the record! |
index | in: clustered index |
type | in: TRX_UNDO_UPD_EXIST_REC, TRX_UNDO_UPD_DEL_REC, or TRX_UNDO_DEL_MARK_REC; in the last case, only trx id and roll ptr fields are added to the update vector |
trx_id | in: transaction id from this undorecord |
roll_ptr | in: roll pointer from this undo record |
info_bits | in: info bits from this undo record |
trx | in: transaction |
heap | in: memory heap from which the memory needed is allocated |