drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
row0undo.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1997, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef row0undo_h
28#define row0undo_h
29
30#include "univ.i"
31#include "mtr0mtr.h"
32#include "trx0sys.h"
33#include "btr0types.h"
34#include "btr0pcur.h"
35#include "dict0types.h"
36#include "trx0types.h"
37#include "que0types.h"
38#include "row0types.h"
39
40/********************************************************************/
43UNIV_INTERN
44undo_node_t*
46/*=================*/
47 trx_t* trx,
48 que_thr_t* parent,
49 mem_heap_t* heap);
50/***********************************************************/
57UNIV_INTERN
58ibool
60/*==========================*/
61 undo_node_t* node);
62/***********************************************************/
66UNIV_INTERN
67que_thr_t*
69/*==========*/
70 que_thr_t* thr);
71
72/* A single query thread will try to perform the undo for all successive
73versions of a clustered index record, if the transaction has modified it
74several times during the execution which is rolled back. It may happen
75that the task is transferred to another query thread, if the other thread
76is assigned to handle an undo log record in the chain of different versions
77of the record, and the other thread happens to get the x-latch to the
78clustered index record at the right time.
79 If a query thread notices that the clustered index record it is looking
80for is missing, or the roll ptr field in the record doed not point to the
81undo log record the thread was assigned to handle, then it gives up the undo
82task for that undo log record, and fetches the next. This situation can occur
83just in the case where the transaction modified the same record several times
84and another thread is currently doing the undo for successive versions of
85that index record. */
86
101
104 que_common_t common;
106 trx_t* trx;
110 ulint rec_type;
119 dict_table_t* table;
121 upd_t* update;
123 dtuple_t* ref;
124 dtuple_t* row;
126 row_ext_t* ext;
128 dtuple_t* undo_row;
129 row_ext_t* undo_ext;
131 dict_index_t* index;
133 mem_heap_t* heap;
136};
137
138
139#ifndef UNIV_NONINL
140#include "row0undo.ic"
141#endif
142
143#endif
struct btr_pcur_struct btr_pcur_t
Definition btr0types.h:36
undo_exec
Definition row0undo.h:88
@ UNDO_NODE_FETCH_NEXT
Definition row0undo.h:89
@ UNDO_NODE_INSERT
Definition row0undo.h:95
@ UNDO_NODE_MODIFY
Definition row0undo.h:97
@ UNDO_NODE_PREV_VERS
Definition row0undo.h:91
UNIV_INTERN ibool row_undo_search_clust_to_pcur(undo_node_t *node)
Definition row0undo.cc:162
UNIV_INTERN undo_node_t * row_undo_node_create(trx_t *trx, que_thr_t *parent, mem_heap_t *heap)
Definition row0undo.cc:128
UNIV_INTERN que_thr_t * row_undo_step(que_thr_t *thr)
Definition row0undo.cc:349
enum undo_exec state
Definition row0undo.h:105
trx_id_t new_trx_id
Definition row0undo.h:115
mem_heap_t * heap
Definition row0undo.h:133
row_ext_t * ext
Definition row0undo.h:126
dict_index_t * index
Definition row0undo.h:131
dtuple_t * row
Definition row0undo.h:124
row_ext_t * undo_ext
Definition row0undo.h:129
undo_no_t undo_no
Definition row0undo.h:109
que_common_t common
Definition row0undo.h:104
dtuple_t * undo_row
Definition row0undo.h:128
trx_undo_rec_t * undo_rec
Definition row0undo.h:108
roll_ptr_t roll_ptr
Definition row0undo.h:107
dict_table_t * table
Definition row0undo.h:119
btr_pcur_t pcur
Definition row0undo.h:117
dtuple_t * ref
Definition row0undo.h:123
roll_ptr_t new_roll_ptr
Definition row0undo.h:112
byte trx_undo_rec_t
Definition trx0types.h:112
ib_id_t undo_no_t
Definition trx0types.h:89
ib_id_t trx_id_t
Definition trx0types.h:85
ib_id_t roll_ptr_t
Definition trx0types.h:87