MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trx0rec.cc File Reference
#include "trx0rec.h"
#include "fsp0fsp.h"
#include "mach0data.h"
#include "trx0undo.h"
#include "mtr0log.h"
#include "dict0dict.h"
#include "ut0mem.h"
#include "read0read.h"
#include "row0ext.h"
#include "row0upd.h"
#include "que0que.h"
#include "trx0purge.h"
#include "trx0rseg.h"
#include "row0row.h"
Include dependency graph for trx0rec.cc:

Go to the source code of this file.

Macros

#define ATTRIB_USED_ONLY_IN_DEBUG   __attribute__((unused))

Functions

UNIV_INLINE void trx_undof_page_add_undo_rec_log (page_t *undo_page, ulint old_free, ulint new_free, mtr_t *mtr)
UNIV_INTERN byte * trx_undo_parse_add_undo_rec (byte *ptr, byte *end_ptr, page_t *page)
UNIV_INLINE ulint trx_undo_left (const page_t *page, const byte *ptr)
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_INLINE byte * trx_undo_update_rec_get_n_upd_fields (byte *ptr, ulint *n)
UNIV_INLINE byte * trx_undo_update_rec_get_field_no (byte *ptr, ulint *field_no)
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)

Detailed Description

Transaction undo log record

Created 3/26/1996 Heikki Tuuri

Definition in file trx0rec.cc.

Function Documentation

UNIV_INLINE ulint trx_undo_left ( const page_t page,
const byte *  ptr 
)

Calculates the free space left for extending an undo log record.

Returns
bytes left
Parameters
pagein: undo log page
ptrin: pointer to page

Definition at line 143 of file trx0rec.cc.

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.

Returns
end of log record or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
pagein: page or NULL

Definition at line 95 of file trx0rec.cc.

Here is the call graph for this function:

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.

Returns
remaining part of undo log record after reading these values
Parameters
undo_recin: undo log record
typeout: undo record type: TRX_UNDO_INSERT_REC, ...
cmpl_infoout: compiler info, relevant only for update type records
updated_externout: true if we updated an externally stored fild
undo_noout: undo log record number
table_idout: table id

Definition at line 283 of file trx0rec.cc.

Here is the call graph for this function:

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.

Returns
pointer to remaining part of undo record
Parameters
ptrin: 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!
indexin: clustered index
rowout, own: partial row
ignore_prefixin: flag to indicate if we expect blob prefixes in undo. Used only in the assertion.
heapin: memory heap from which the memory needed is allocated

Definition at line 1046 of file trx0rec.cc.

Here is the call graph for this function:

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.

Returns
pointer to remaining part of undo record
Parameters
ptrin: 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!
indexin: clustered index
refout, own: row reference
heapin: memory heap from which the memory needed is allocated

Definition at line 378 of file trx0rec.cc.

Here is the call graph for this function:

UNIV_INTERN byte* trx_undo_rec_skip_row_ref ( byte *  ptr,
dict_index_t index 
)

Skips a row reference from an undo log record.

Returns
pointer to remaining part of undo record
Parameters
ptrin: remaining part in update undo log record, at the start of the row reference
indexin: clustered index

Definition at line 424 of file trx0rec.cc.

Here is the call graph for this function:

UNIV_INLINE byte* trx_undo_update_rec_get_field_no ( byte *  ptr,
ulint *  field_no 
)

Reads from an update undo log record a stored field number.

Returns
remaining part of undo log record after reading this value
Parameters
ptrin: pointer to remaining part of undo log record
field_noout: field number

Definition at line 901 of file trx0rec.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INLINE byte* trx_undo_update_rec_get_n_upd_fields ( byte *  ptr,
ulint *  n 
)

Reads from an update undo log record the number of updated fields.

Returns
remaining part of undo log record after reading this value
Parameters
ptrin: pointer to remaining part of undo log record
nout: number of fields

Definition at line 885 of file trx0rec.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns
remaining part of undo log record after reading these values
Parameters
ptrin: remaining part of undo log record after reading general parameters
trx_idout: trx id
roll_ptrout: roll ptr
info_bitsout: info bits state

Definition at line 856 of file trx0rec.cc.

Here is the call graph for this function:

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.

Returns
remaining part of the record, NULL if an error detected, which means that the record is corrupted
Parameters
ptrin: 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!
indexin: clustered index
typein: 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_idin: transaction id from this undo record
roll_ptrin: roll pointer from this undo record
info_bitsin: info bits from this undo record
trxin: transaction
heapin: memory heap from which the memory needed is allocated
updout, own: update vector

Definition at line 918 of file trx0rec.cc.

Here is the call graph for this function:

UNIV_INLINE void trx_undof_page_add_undo_rec_log ( page_t undo_page,
ulint  old_free,
ulint  new_free,
mtr_t mtr 
)

Writes the mtr log entry of the inserted undo log record on the undo log page.

Parameters
undo_pagein: undo log page
old_freein: start offset of the inserted entry
new_freein: end offset of the entry
mtrin: mtr

Definition at line 54 of file trx0rec.cc.

Here is the call graph for this function: