1
/*****************************************************************************
3
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/trx0rec.ic
21
Transaction undo log record
23
Created 3/26/1996 Heikki Tuuri
24
*******************************************************/
26
#ifndef UNIV_HOTBACKUP
27
/**********************************************************************//**
28
Reads from an undo log record the record type.
29
@return record type */
32
trx_undo_rec_get_type(
33
/*==================*/
34
const trx_undo_rec_t* undo_rec) /*!< in: undo log record */
36
return(mach_read_from_1(undo_rec + 2) & (TRX_UNDO_CMPL_INFO_MULT - 1));
39
/**********************************************************************//**
40
Reads from an undo log record the record compiler info.
41
@return compiler info */
44
trx_undo_rec_get_cmpl_info(
45
/*=======================*/
46
const trx_undo_rec_t* undo_rec) /*!< in: undo log record */
48
return(mach_read_from_1(undo_rec + 2) / TRX_UNDO_CMPL_INFO_MULT);
51
/**********************************************************************//**
52
Returns TRUE if an undo log record contains an extern storage field.
53
@return TRUE if extern */
56
trx_undo_rec_get_extern_storage(
57
/*============================*/
58
const trx_undo_rec_t* undo_rec) /*!< in: undo log record */
60
if (mach_read_from_1(undo_rec + 2) & TRX_UNDO_UPD_EXTERN) {
68
/**********************************************************************//**
69
Reads the undo log record number.
73
trx_undo_rec_get_undo_no(
74
/*=====================*/
75
const trx_undo_rec_t* undo_rec) /*!< in: undo log record */
81
return(mach_ull_read_much_compressed(ptr));
84
/**********************************************************************//**
85
Returns the start of the undo record data area.
86
@return offset to the data area */
89
trx_undo_rec_get_offset(
90
/*====================*/
91
undo_no_t undo_no) /*!< in: undo no read from node */
93
return (3 + mach_ull_get_much_compressed_size(undo_no));
96
/***********************************************************************//**
97
Copies the undo record to the heap.
98
@return own: copy of undo log record */
103
const trx_undo_rec_t* undo_rec, /*!< in: undo log record */
104
mem_heap_t* heap) /*!< in: heap where copied */
108
len = mach_read_from_2(undo_rec)
109
- ut_align_offset(undo_rec, UNIV_PAGE_SIZE);
110
return (trx_undo_rec_t*)mem_heap_dup(heap, undo_rec, len);
112
#endif /* !UNIV_HOTBACKUP */