mariadb/include/row0purge.h

96 lines
3.2 KiB
C
Raw Normal View History

/*****************************************************************************
Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
2005-10-27 07:29:40 +00:00
/******************************************************
Purge obsolete records
Created 3/14/1997 Heikki Tuuri
*******************************************************/
#ifndef row0purge_h
#define row0purge_h
#include "univ.i"
#include "data0data.h"
#include "btr0types.h"
#include "btr0pcur.h"
#include "dict0types.h"
#include "trx0types.h"
#include "que0types.h"
#include "row0types.h"
2005-10-27 07:29:40 +00:00
/************************************************************************
Creates a purge node to a query graph.
@return own: purge node */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
purge_node_t*
row_purge_node_create(
/*==================*/
que_thr_t* parent, /*!< in: parent node, i.e., a thr node */
mem_heap_t* heap); /*!< in: memory heap where created */
2005-10-27 07:29:40 +00:00
/***************************************************************
Does the purge operation for a single undo log record. This is a high-level
function used in an SQL execution graph.
@return query thread to run next or NULL */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
que_thr_t*
row_purge_step(
/*===========*/
que_thr_t* thr); /*!< in: query thread */
2005-10-27 07:29:40 +00:00
/* Purge node structure */
struct purge_node_struct{
que_common_t common; /* node type: QUE_NODE_PURGE */
/*----------------------*/
/* Local storage for this graph node */
roll_ptr_t roll_ptr;/* roll pointer to undo log record */
2005-10-27 07:29:40 +00:00
trx_undo_rec_t* undo_rec;/* undo log record */
trx_undo_inf_t* reservation;/* reservation for the undo log record in
the purge array */
undo_no_t undo_no;/* undo number of the record */
2005-10-27 07:29:40 +00:00
ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC,
... */
btr_pcur_t pcur; /* persistent cursor used in searching the
clustered index record */
ibool found_clust;/* TRUE if the clustered index record
determined by ref was found in the clustered
index, and we were able to position pcur on
it */
dict_table_t* table; /* table where purge is done */
2005-10-27 07:29:40 +00:00
ulint cmpl_info;/* compiler analysis info of an update */
upd_t* update; /* update vector for a clustered index
record */
2005-10-27 07:29:40 +00:00
dtuple_t* ref; /* NULL, or row reference to the next row to
handle */
dtuple_t* row; /* NULL, or a copy (also fields copied to
heap) of the indexed fields of the row to
handle */
dict_index_t* index; /* NULL, or the next index whose record should
be handled */
mem_heap_t* heap; /* memory heap used as auxiliary storage for
row; this must be emptied after a successful
purge of a row */
};
#ifndef UNIV_NONINL
#include "row0purge.ic"
#endif
#endif