InnoDB Plugin  1.0
Functions
trx0undo.ic File Reference
#include "data0type.h"
#include "page0page.h"
Include dependency graph for trx0undo.ic:
This graph shows which files directly or indirectly include this file:

Functions

UNIV_INLINE roll_ptr_t trx_undo_build_roll_ptr (ibool is_insert, ulint rseg_id, ulint page_no, ulint offset)
UNIV_INLINE void trx_undo_decode_roll_ptr (roll_ptr_t roll_ptr, ibool *is_insert, ulint *rseg_id, ulint *page_no, ulint *offset)
UNIV_INLINE ibool trx_undo_roll_ptr_is_insert (roll_ptr_t roll_ptr)
UNIV_INLINE bool trx_undo_trx_id_is_insert (const byte *trx_id)
UNIV_INLINE void trx_write_roll_ptr (byte *ptr, roll_ptr_t roll_ptr)
UNIV_INLINE roll_ptr_t trx_read_roll_ptr (const byte *ptr)
UNIV_INLINE page_ttrx_undo_page_get (ulint space, ulint zip_size, ulint page_no, mtr_t *mtr)
UNIV_INLINE page_ttrx_undo_page_get_s_latched (ulint space, ulint zip_size, ulint page_no, mtr_t *mtr)
UNIV_INLINE ulint trx_undo_page_get_start (page_t *undo_page, ulint page_no, ulint offset)
UNIV_INLINE ulint trx_undo_page_get_end (page_t *undo_page, ulint page_no, ulint offset)
UNIV_INLINE trx_undo_rec_ttrx_undo_page_get_prev_rec (trx_undo_rec_t *rec, ulint page_no, ulint offset)
UNIV_INLINE trx_undo_rec_ttrx_undo_page_get_next_rec (trx_undo_rec_t *rec, ulint page_no, ulint offset)
UNIV_INLINE trx_undo_rec_ttrx_undo_page_get_last_rec (page_t *undo_page, ulint page_no, ulint offset)
UNIV_INLINE trx_undo_rec_ttrx_undo_page_get_first_rec (page_t *undo_page, ulint page_no, ulint offset)

Detailed Description

Transaction undo log

Created 3/26/1996 Heikki Tuuri

Function Documentation

UNIV_INLINE roll_ptr_t trx_read_roll_ptr ( const byte *  ptr)

Reads a roll ptr from an index page. In case that the roll ptr size changes in some future version, this function should be used instead of mach_read_...

Returns
roll ptr
Parameters
ptrin: pointer to memory from where to read
UNIV_INLINE roll_ptr_t trx_undo_build_roll_ptr ( ibool  is_insert,
ulint  rseg_id,
ulint  page_no,
ulint  offset 
)

Builds a roll pointer.

Returns
roll pointer
Parameters
is_insertin: TRUE if insert undo log
rseg_idin: rollback segment id
page_noin: page number
offsetin: offset of the undo entry within page
UNIV_INLINE void trx_undo_decode_roll_ptr ( roll_ptr_t  roll_ptr,
ibool is_insert,
ulint *  rseg_id,
ulint *  page_no,
ulint *  offset 
)

Decodes a roll pointer.

Parameters
roll_ptrin: roll pointer
is_insertout: TRUE if insert undo log
rseg_idout: rollback segment id
page_noout: page number
offsetout: offset of the undo entry within page
UNIV_INLINE page_t* trx_undo_page_get ( ulint  space,
ulint  zip_size,
ulint  page_no,
mtr_t mtr 
)

Gets an undo log page and x-latches it.

Returns
pointer to page x-latched
Parameters
spacein: space where placed
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
page_noin: page number
mtrin: mtr
UNIV_INLINE ulint trx_undo_page_get_end ( page_t undo_page,
ulint  page_no,
ulint  offset 
)

Returns the end offset of the undo log records of the specified undo log on the page.

Returns
end offset
Parameters
undo_pagein: undo log page
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE trx_undo_rec_t* trx_undo_page_get_first_rec ( page_t undo_page,
ulint  page_no,
ulint  offset 
)

Returns the first undo record on the page in the specified undo log, or NULL if none exists.

Returns
pointer to record, NULL if none
Parameters
undo_pagein: undo log page
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE trx_undo_rec_t* trx_undo_page_get_last_rec ( page_t undo_page,
ulint  page_no,
ulint  offset 
)

Returns the last undo record on the page in the specified undo log, or NULL if none exists.

Returns
pointer to record, NULL if none
Parameters
undo_pagein: undo log page
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE trx_undo_rec_t* trx_undo_page_get_next_rec ( trx_undo_rec_t rec,
ulint  page_no,
ulint  offset 
)

Returns the next undo log record on the page in the specified log, or NULL if none exists.

Returns
pointer to record, NULL if none
Parameters
recin: undo log record
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE trx_undo_rec_t* trx_undo_page_get_prev_rec ( trx_undo_rec_t rec,
ulint  page_no,
ulint  offset 
)

Returns the previous undo record on the page in the specified log, or NULL if none exists.

Returns
pointer to record, NULL if none
Parameters
recin: undo log record
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE page_t* trx_undo_page_get_s_latched ( ulint  space,
ulint  zip_size,
ulint  page_no,
mtr_t mtr 
)

Gets an undo log page and s-latches it.

Returns
pointer to page s-latched
Parameters
spacein: space where placed
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
page_noin: page number
mtrin: mtr
UNIV_INLINE ulint trx_undo_page_get_start ( page_t undo_page,
ulint  page_no,
ulint  offset 
)

Returns the start offset of the undo log records of the specified undo log on the page.

Returns
start offset
Parameters
undo_pagein: undo log page
page_noin: undo log header page number
offsetin: undo log header offset on page
UNIV_INLINE ibool trx_undo_roll_ptr_is_insert ( roll_ptr_t  roll_ptr)

Returns TRUE if the roll pointer is of the insert type.

Returns
TRUE if insert undo log
Parameters
roll_ptrin: roll pointer
UNIV_INLINE bool trx_undo_trx_id_is_insert ( const byte *  trx_id)

Returns true if the record is of the insert type.

Returns
true if the record was freshly inserted (not updated).
Parameters
trx_idin: DB_TRX_ID, followed by DB_ROLL_PTR
UNIV_INLINE void trx_write_roll_ptr ( byte *  ptr,
roll_ptr_t  roll_ptr 
)

Writes a roll ptr to an index page. In case that the size changes in some future version, this function should be used instead of mach_write_...

Parameters
ptrin: pointer to memory where written
roll_ptrin: roll ptr