1
/*****************************************************************************
3
Copyright (c) 1997, 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
Purge obsolete records
22
Created 3/14/1997 Heikki Tuuri
23
*******************************************************/
29
#include "data0data.h"
30
#include "btr0types.h"
32
#include "dict0types.h"
33
#include "trx0types.h"
34
#include "que0types.h"
35
#include "row0types.h"
37
/************************************************************************
38
Creates a purge node to a query graph. */
41
row_purge_node_create(
42
/*==================*/
43
/* out, own: purge node */
44
que_thr_t* parent, /* in: parent node, i.e., a thr node */
45
mem_heap_t* heap); /* in: memory heap where created */
46
/***************************************************************
47
Does the purge operation for a single undo log record. This is a high-level
48
function used in an SQL execution graph. */
53
/* out: query thread to run next or NULL */
54
que_thr_t* thr); /* in: query thread */
56
/* Purge node structure */
58
struct purge_node_struct{
59
que_common_t common; /* node type: QUE_NODE_PURGE */
60
/*----------------------*/
61
/* Local storage for this graph node */
62
dulint roll_ptr;/* roll pointer to undo log record */
63
trx_undo_rec_t* undo_rec;/* undo log record */
64
trx_undo_inf_t* reservation;/* reservation for the undo log record in
66
dulint undo_no;/* undo number of the record */
67
ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC,
69
btr_pcur_t pcur; /* persistent cursor used in searching the
70
clustered index record */
71
ibool found_clust;/* TRUE if the clustered index record
72
determined by ref was found in the clustered
73
index, and we were able to position pcur on
75
dict_table_t* table; /* table where purge is done */
76
ulint cmpl_info;/* compiler analysis info of an update */
77
upd_t* update; /* update vector for a clustered index
79
dtuple_t* ref; /* NULL, or row reference to the next row to
81
dtuple_t* row; /* NULL, or a copy (also fields copied to
82
heap) of the indexed fields of the row to
84
dict_index_t* index; /* NULL, or the next index whose record should
86
mem_heap_t* heap; /* memory heap used as auxiliary storage for
87
row; this must be emptied after a successful
92
#include "row0purge.ic"