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., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/trx0types.h
21
Transaction system global type definitions
23
Created 3/26/1996 Heikki Tuuri
24
*******************************************************/
31
/** prepare trx_t::id for being printed via printf(3) */
32
#define TRX_ID_PREP_PRINTF(id) (ullint) ut_conv_dulint_to_longlong(id)
34
/** printf(3) format used for printing TRX_ID_PRINTF_PREP() */
35
#define TRX_ID_FMT "%llX"
37
/** maximum length that a formatted trx_t::id could take, not including
38
the terminating NUL character. */
39
#define TRX_ID_MAX_LEN 17
44
typedef struct trx_struct trx_t;
45
/** Transaction system */
46
typedef struct trx_sys_struct trx_sys_t;
47
/** Doublewrite information */
48
typedef struct trx_doublewrite_struct trx_doublewrite_t;
50
typedef struct trx_sig_struct trx_sig_t;
51
/** Rollback segment */
52
typedef struct trx_rseg_struct trx_rseg_t;
53
/** Transaction undo log */
54
typedef struct trx_undo_struct trx_undo_t;
55
/** Array of undo numbers of undo records being rolled back or purged */
56
typedef struct trx_undo_arr_struct trx_undo_arr_t;
57
/** A cell of trx_undo_arr_t */
58
typedef struct trx_undo_inf_struct trx_undo_inf_t;
59
/** The control structure used in the purge operation */
60
typedef struct trx_purge_struct trx_purge_t;
61
/** Rollback command node in a query graph */
62
typedef struct roll_node_struct roll_node_t;
63
/** Commit command node in a query graph */
64
typedef struct commit_node_struct commit_node_t;
65
/** SAVEPOINT command node in a query graph */
66
typedef struct trx_named_savept_struct trx_named_savept_t;
69
/** Rollback contexts */
71
RB_NONE = 0, /*!< no rollback */
72
RB_NORMAL, /*!< normal rollback */
73
RB_RECOVERY /*!< rolling back an incomplete transaction,
77
/** Transaction identifier (DB_TRX_ID, DATA_TRX_ID) */
78
typedef dulint trx_id_t;
79
/** Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR) */
80
typedef dulint roll_ptr_t;
82
typedef dulint undo_no_t;
84
/** Transaction savepoint */
85
typedef struct trx_savept_struct trx_savept_t;
86
/** Transaction savepoint */
87
struct trx_savept_struct{
88
undo_no_t least_undo_no; /*!< least undo number to undo */
93
/** Transaction system header */
94
typedef byte trx_sysf_t;
95
/** Rollback segment header */
96
typedef byte trx_rsegf_t;
97
/** Undo segment header */
98
typedef byte trx_usegf_t;
99
/** Undo log header */
100
typedef byte trx_ulogf_t;
101
/** Undo log page header */
102
typedef byte trx_upagef_t;
104
/** Undo log record */
105
typedef byte trx_undo_rec_t;