1 /*****************************************************************************
3 Copyright (c) 1996, 2010, 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.,
15 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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_PURGE_REC
,
74 /*!< rolling back an incomplete transaction,
75 in crash recovery, rolling back an
76 INSERT that was performed by updating a
77 delete-marked record; if the delete-marked record
78 no longer exists in an active read view, it will
80 RB_RECOVERY
/*!< rolling back an incomplete transaction,
84 /** Transaction identifier (DB_TRX_ID, DATA_TRX_ID) */
85 typedef dulint trx_id_t
;
86 /** Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR) */
87 typedef dulint roll_ptr_t
;
89 typedef dulint undo_no_t
;
91 /** Transaction savepoint */
92 typedef struct trx_savept_struct trx_savept_t
;
93 /** Transaction savepoint */
94 struct trx_savept_struct
{
95 undo_no_t least_undo_no
; /*!< least undo number to undo */
100 /** Transaction system header */
101 typedef byte trx_sysf_t
;
102 /** Rollback segment header */
103 typedef byte trx_rsegf_t
;
104 /** Undo segment header */
105 typedef byte trx_usegf_t
;
106 /** Undo log header */
107 typedef byte trx_ulogf_t
;
108 /** Undo log page header */
109 typedef byte trx_upagef_t
;
111 /** Undo log record */
112 typedef byte trx_undo_rec_t
;