2009-02-17 09:43:50 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Copyright (c) 1996, 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
|
|
|
/******************************************************
|
|
|
|
Transaction system global type definitions
|
|
|
|
|
|
|
|
Created 3/26/1996 Heikki Tuuri
|
|
|
|
*******************************************************/
|
|
|
|
|
|
|
|
#ifndef trx0types_h
|
|
|
|
#define trx0types_h
|
|
|
|
|
|
|
|
#include "ut0byte.h"
|
|
|
|
|
2007-12-20 14:08:16 +00:00
|
|
|
/* prepare trx_t::id for being printed via printf(3) */
|
|
|
|
#define TRX_ID_PREP_PRINTF(id) (ullint) ut_conv_dulint_to_longlong(id)
|
|
|
|
|
|
|
|
/* printf(3) format used for printing TRX_ID_PRINTF_PREP() */
|
|
|
|
#define TRX_ID_FMT "%llX"
|
|
|
|
|
2007-12-20 14:24:57 +00:00
|
|
|
/* maximum length that a formatted trx_t::id could take, not including
|
|
|
|
the terminating '\0'. */
|
|
|
|
#define TRX_ID_MAX_LEN 17
|
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
/* Memory objects */
|
|
|
|
typedef struct trx_struct trx_t;
|
|
|
|
typedef struct trx_sys_struct trx_sys_t;
|
|
|
|
typedef struct trx_doublewrite_struct trx_doublewrite_t;
|
|
|
|
typedef struct trx_sig_struct trx_sig_t;
|
|
|
|
typedef struct trx_rseg_struct trx_rseg_t;
|
|
|
|
typedef struct trx_undo_struct trx_undo_t;
|
|
|
|
typedef struct trx_undo_arr_struct trx_undo_arr_t;
|
|
|
|
typedef struct trx_undo_inf_struct trx_undo_inf_t;
|
|
|
|
typedef struct trx_purge_struct trx_purge_t;
|
|
|
|
typedef struct roll_node_struct roll_node_t;
|
|
|
|
typedef struct commit_node_struct commit_node_t;
|
|
|
|
typedef struct trx_named_savept_struct trx_named_savept_t;
|
|
|
|
|
2008-08-06 08:59:28 +00:00
|
|
|
/* Rollback contexts */
|
|
|
|
enum trx_rb_ctx {
|
branches/zip: In the rollback of incomplete transactions after crash
recovery, tolerate clustered index records whose externally stored
columns have not been written. This should remove the assertion failures
that were reported as Mantis issue#58, issue#62, issue#64.
trx_is_recv(): New function: TRUE if this transaction is rolling back
an incomplete transaction in crash recovery.
enum trx_rbmode: Rollback modes: no rollback, normal rollback, crash recovery.
btr_cur_pessimistic_delete(), btr_free_externally_stored_field(),
btr_rec_free_externally_stored_fields():
Replace the ibool parameter with enum trx_rbmode.
btr_free_externally_stored_field(): If field_ref is zero, return
but assert ut_a(rbmode == RB_RECOVERY). Unless InnoDB has crashed
while inserting a clustered index record, field_ref should not be zero.
btr_rec_free_updated_extern_fields(): Add the parameter enum trx_rbmode.
btr_cur_pessimistic_update(): Pass the rbmode parameter to
btr_rec_free_updated_extern_fields().
row_undo_ins(), row_undo_mod_upd_del_sec(): If row_build_index_entry()
fails, assert trx_is_recv() and skip this secondary index.
row_undo_mod_upd_del_sec(): Empty the heap at the end of each loop
iteration in order to conserve memory and to reduce the number of
low-level memory allocations.
2008-08-06 08:48:34 +00:00
|
|
|
RB_NONE = 0, /* no rollback */
|
|
|
|
RB_NORMAL, /* normal rollback */
|
|
|
|
RB_RECOVERY, /* rolling back an incomplete transaction,
|
|
|
|
in crash recovery */
|
|
|
|
};
|
|
|
|
|
2009-04-23 05:32:36 +00:00
|
|
|
typedef dulint trx_id_t;
|
|
|
|
typedef dulint roll_ptr_t;
|
|
|
|
typedef dulint undo_no_t;
|
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
/* Transaction savepoint */
|
|
|
|
typedef struct trx_savept_struct trx_savept_t;
|
|
|
|
struct trx_savept_struct{
|
2009-04-23 05:32:36 +00:00
|
|
|
undo_no_t least_undo_no; /* least undo number to undo */
|
2005-10-27 07:29:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* File objects */
|
|
|
|
typedef byte trx_sysf_t;
|
|
|
|
typedef byte trx_rsegf_t;
|
|
|
|
typedef byte trx_usegf_t;
|
|
|
|
typedef byte trx_ulogf_t;
|
|
|
|
typedef byte trx_upagef_t;
|
|
|
|
|
|
|
|
/* Undo log record */
|
|
|
|
typedef byte trx_undo_rec_t;
|
|
|
|
|
2006-02-23 19:25:29 +00:00
|
|
|
#endif
|