2009-02-17 09:41:24 +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
|
|
|
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2009-05-25 09:52:29 +00:00
|
|
|
/**************************************************//**
|
|
|
|
@file include/trx0roll.h
|
2005-10-27 07:29:40 +00:00
|
|
|
Transaction rollback
|
|
|
|
|
|
|
|
Created 3/26/1996 Heikki Tuuri
|
|
|
|
*******************************************************/
|
|
|
|
|
|
|
|
#ifndef trx0roll_h
|
|
|
|
#define trx0roll_h
|
|
|
|
|
|
|
|
#include "univ.i"
|
|
|
|
#include "trx0trx.h"
|
|
|
|
#include "trx0types.h"
|
|
|
|
#include "mtr0mtr.h"
|
|
|
|
#include "trx0sys.h"
|
|
|
|
|
2009-01-14 14:06:22 +00:00
|
|
|
#define trx_roll_free_all_savepoints(s) trx_roll_savepoints_free((s), NULL)
|
|
|
|
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
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
|
|
|
Determines if this transaction is rolling back an incomplete transaction
|
2009-05-25 05:30:14 +00:00
|
|
|
in crash recovery.
|
2009-05-25 08:09:45 +00:00
|
|
|
@return TRUE if trx is an incomplete transaction that is being rolled
|
|
|
|
back in crash recovery */
|
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
|
|
|
UNIV_INTERN
|
|
|
|
ibool
|
|
|
|
trx_is_recv(
|
|
|
|
/*========*/
|
2009-05-25 05:30:14 +00:00
|
|
|
const trx_t* trx); /*!< in: transaction */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Returns a transaction savepoint taken at this point in time.
|
|
|
|
@return savepoint */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_savept_t
|
|
|
|
trx_savept_take(
|
|
|
|
/*============*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx); /*!< in: transaction */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Creates an undo number array. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_undo_arr_t*
|
|
|
|
trx_undo_arr_create(void);
|
|
|
|
/*=====================*/
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Frees an undo number array. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_undo_arr_free(
|
|
|
|
/*==============*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_undo_arr_t* arr); /*!< in: undo number array */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Returns pointer to nth element in an undo number array.
|
|
|
|
@return pointer to the nth element */
|
2005-10-27 07:29:40 +00:00
|
|
|
UNIV_INLINE
|
|
|
|
trx_undo_inf_t*
|
|
|
|
trx_undo_arr_get_nth_info(
|
|
|
|
/*======================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_undo_arr_t* arr, /*!< in: undo number array */
|
|
|
|
ulint n); /*!< in: position */
|
2009-05-25 09:52:29 +00:00
|
|
|
/***********************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Tries truncate the undo logs. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_roll_try_truncate(
|
|
|
|
/*==================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx); /*!< in/out: transaction */
|
2009-05-25 09:52:29 +00:00
|
|
|
/********************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Pops the topmost record when the two undo logs of a transaction are seen
|
|
|
|
as a single stack of records ordered by their undo numbers. Inserts the
|
|
|
|
undo number of the popped undo record to the array of currently processed
|
|
|
|
undo numbers in the transaction. When the query thread finishes processing
|
2009-05-25 05:30:14 +00:00
|
|
|
of this undo record, it must be released with trx_undo_rec_release.
|
2009-05-25 08:09:45 +00:00
|
|
|
@return undo log record copied to heap, NULL if none left, or if the
|
|
|
|
undo number of the top record would be less than the limit */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_undo_rec_t*
|
|
|
|
trx_roll_pop_top_rec_of_trx(
|
|
|
|
/*========================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction */
|
|
|
|
undo_no_t limit, /*!< in: least undo number we need */
|
|
|
|
roll_ptr_t* roll_ptr,/*!< out: roll pointer to undo record */
|
|
|
|
mem_heap_t* heap); /*!< in: memory heap where copied */
|
2009-05-25 09:52:29 +00:00
|
|
|
/********************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Reserves an undo log record for a query thread to undo. This should be
|
|
|
|
called if the query thread gets the undo log record not using the pop
|
2009-05-25 05:30:14 +00:00
|
|
|
function above.
|
|
|
|
@return TRUE if succeeded */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ibool
|
|
|
|
trx_undo_rec_reserve(
|
|
|
|
/*=================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in/out: transaction */
|
|
|
|
undo_no_t undo_no);/*!< in: undo number of the record */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Releases a reserved undo record. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_undo_rec_release(
|
|
|
|
/*=================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in/out: transaction */
|
|
|
|
undo_no_t undo_no);/*!< in: undo number */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*********************************************************************//**
|
2006-02-23 19:25:29 +00:00
|
|
|
Starts a rollback operation. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_rollback(
|
|
|
|
/*=========*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction */
|
|
|
|
trx_sig_t* sig, /*!< in: signal starting the rollback */
|
|
|
|
que_thr_t** next_thr);/*!< in/out: next query thread to run;
|
2005-10-27 07:29:40 +00:00
|
|
|
if the value which is passed in is
|
|
|
|
a pointer to a NULL pointer, then the
|
|
|
|
calling function can start running
|
|
|
|
a new query thread */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2007-10-30 08:25:01 +00:00
|
|
|
Rollback or clean up any incomplete transactions which were
|
|
|
|
encountered in crash recovery. If the transaction already was
|
|
|
|
committed, then we clean up a possible insert undo log. If the
|
|
|
|
transaction was not yet committed, then we roll it back.
|
2009-05-25 05:30:14 +00:00
|
|
|
Note: this is done in a background thread.
|
|
|
|
@return a dummy parameter */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2006-05-08 06:18:59 +00:00
|
|
|
os_thread_ret_t
|
2007-10-30 08:25:01 +00:00
|
|
|
trx_rollback_or_clean_all_recovered(
|
|
|
|
/*================================*/
|
2006-02-23 19:25:29 +00:00
|
|
|
void* arg __attribute__((unused)));
|
2009-05-25 05:30:14 +00:00
|
|
|
/*!< in: a dummy parameter required by
|
2006-02-23 19:25:29 +00:00
|
|
|
os_thread_create */
|
2009-05-25 09:52:29 +00:00
|
|
|
/****************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Finishes a transaction rollback. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_finish_rollback_off_kernel(
|
|
|
|
/*===========================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
que_t* graph, /*!< in: undo graph which can now be freed */
|
|
|
|
trx_t* trx, /*!< in: transaction */
|
|
|
|
que_thr_t** next_thr);/*!< in/out: next query thread to run;
|
2005-10-27 07:29:40 +00:00
|
|
|
if the value which is passed in is
|
|
|
|
a pointer to a NULL pointer, then the
|
2006-02-23 19:25:29 +00:00
|
|
|
calling function can start running
|
2005-10-27 07:29:40 +00:00
|
|
|
a new query thread; if this parameter is
|
|
|
|
NULL, it is ignored */
|
2009-05-25 09:52:29 +00:00
|
|
|
/****************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Builds an undo 'query' graph for a transaction. The actual rollback is
|
|
|
|
performed by executing this query graph like a query subprocedure call.
|
|
|
|
The reply about the completion of the rollback will be sent by this
|
2009-05-25 05:30:14 +00:00
|
|
|
graph.
|
|
|
|
@return own: the query graph */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
que_t*
|
|
|
|
trx_roll_graph_build(
|
|
|
|
/*=================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx); /*!< in: trx handle */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*********************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Creates a rollback command node struct.
|
|
|
|
@return own: rollback node struct */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
roll_node_t*
|
|
|
|
roll_node_create(
|
|
|
|
/*=============*/
|
2009-05-25 05:30:14 +00:00
|
|
|
mem_heap_t* heap); /*!< in: mem heap where created */
|
2009-05-25 09:52:29 +00:00
|
|
|
/***********************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Performs an execution step for a rollback command node in a query graph.
|
|
|
|
@return query thread to run next, or NULL */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
que_thr_t*
|
|
|
|
trx_rollback_step(
|
|
|
|
/*==============*/
|
2009-05-25 05:30:14 +00:00
|
|
|
que_thr_t* thr); /*!< in: query thread */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Rollback a transaction used in MySQL.
|
|
|
|
@return error code or DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
int
|
|
|
|
trx_rollback_for_mysql(
|
|
|
|
/*===================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx); /*!< in: transaction handle */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Rollback the latest SQL statement for MySQL.
|
|
|
|
@return error code or DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
int
|
|
|
|
trx_rollback_last_sql_stat_for_mysql(
|
|
|
|
/*=================================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx); /*!< in: transaction handle */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-05-25 05:30:14 +00:00
|
|
|
Rollback a transaction used in MySQL.
|
|
|
|
@return error code or DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
int
|
|
|
|
trx_general_rollback_for_mysql(
|
|
|
|
/*===========================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
trx_savept_t* savept);/*!< in: pointer to savepoint undo number, if
|
2009-08-11 10:42:37 +00:00
|
|
|
partial rollback requested, or NULL for
|
|
|
|
complete rollback */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Rolls back a transaction back to a named savepoint. Modifications after the
|
|
|
|
savepoint are undone but InnoDB does NOT release the corresponding locks
|
|
|
|
which are stored in memory. If a lock is 'implicit', that is, a new inserted
|
2006-02-23 19:25:29 +00:00
|
|
|
row holds a lock where the lock information is carried by the trx id stored in
|
2005-10-27 07:29:40 +00:00
|
|
|
the row, these locks are naturally released in the rollback. Savepoints which
|
2009-05-25 05:30:14 +00:00
|
|
|
were set after this savepoint are deleted.
|
2009-05-25 08:09:45 +00:00
|
|
|
@return if no savepoint of the name found then DB_NO_SAVEPOINT,
|
|
|
|
otherwise DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_rollback_to_savepoint_for_mysql(
|
|
|
|
/*================================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
const char* savepoint_name, /*!< in: savepoint name */
|
|
|
|
ib_int64_t* mysql_binlog_cache_pos);/*!< out: the MySQL binlog cache
|
2005-10-27 07:29:40 +00:00
|
|
|
position corresponding to this
|
|
|
|
savepoint; MySQL needs this
|
|
|
|
information to remove the
|
|
|
|
binlog entries of the queries
|
|
|
|
executed after the savepoint */
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Creates a named savepoint. If the transaction is not yet started, starts it.
|
|
|
|
If there is already a savepoint of the same name, this call erases that old
|
|
|
|
savepoint and replaces it with a new. Savepoints are deleted in a transaction
|
2009-05-25 05:30:14 +00:00
|
|
|
commit or rollback.
|
|
|
|
@return always DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_savepoint_for_mysql(
|
|
|
|
/*====================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
const char* savepoint_name, /*!< in: savepoint name */
|
|
|
|
ib_int64_t binlog_cache_pos); /*!< in: MySQL binlog cache
|
2005-10-27 07:29:40 +00:00
|
|
|
position corresponding to this
|
|
|
|
connection at the time of the
|
|
|
|
savepoint */
|
2006-02-23 19:25:29 +00:00
|
|
|
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2005-10-27 07:29:40 +00:00
|
|
|
Releases a named savepoint. Savepoints which
|
2009-05-25 05:30:14 +00:00
|
|
|
were set after this savepoint are deleted.
|
2009-05-25 08:09:45 +00:00
|
|
|
@return if no savepoint of the name found then DB_NO_SAVEPOINT,
|
|
|
|
otherwise DB_SUCCESS */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_release_savepoint_for_mysql(
|
2006-02-23 19:25:29 +00:00
|
|
|
/*============================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
const char* savepoint_name); /*!< in: savepoint name */
|
2005-10-27 07:29:40 +00:00
|
|
|
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-01-14 14:06:22 +00:00
|
|
|
Frees a single savepoint struct. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2009-01-14 14:06:22 +00:00
|
|
|
void
|
|
|
|
trx_roll_savepoint_free(
|
|
|
|
/*=====================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
trx_named_savept_t* savep); /*!< in: savepoint to free */
|
2009-01-14 14:06:22 +00:00
|
|
|
|
2009-05-25 09:52:29 +00:00
|
|
|
/*******************************************************************//**
|
2009-01-14 14:06:22 +00:00
|
|
|
Frees savepoint structs starting from savep, if savep == NULL then
|
|
|
|
free all savepoints. */
|
2009-04-08 10:24:49 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_roll_savepoints_free(
|
|
|
|
/*=====================*/
|
2009-05-25 05:30:14 +00:00
|
|
|
trx_t* trx, /*!< in: transaction handle */
|
|
|
|
trx_named_savept_t* savep); /*!< in: free all savepoints > this one;
|
2005-10-27 07:29:40 +00:00
|
|
|
if this is NULL, free all savepoints
|
|
|
|
of trx */
|
|
|
|
|
2009-05-26 12:28:49 +00:00
|
|
|
/** A cell of trx_undo_arr_struct; used during a rollback and a purge */
|
2005-10-27 07:29:40 +00:00
|
|
|
struct trx_undo_inf_struct{
|
2009-05-26 12:28:49 +00:00
|
|
|
trx_id_t trx_no; /*!< transaction number: not defined during
|
2005-10-27 07:29:40 +00:00
|
|
|
a rollback */
|
2009-05-26 12:28:49 +00:00
|
|
|
undo_no_t undo_no;/*!< undo number of an undo record */
|
|
|
|
ibool in_use; /*!< TRUE if the cell is in use */
|
2005-10-27 07:29:40 +00:00
|
|
|
};
|
|
|
|
|
2009-05-26 12:28:49 +00:00
|
|
|
/** During a rollback and a purge, undo numbers of undo records currently being
|
2005-10-27 07:29:40 +00:00
|
|
|
processed are stored in this array */
|
|
|
|
|
|
|
|
struct trx_undo_arr_struct{
|
2009-05-26 12:28:49 +00:00
|
|
|
ulint n_cells; /*!< number of cells in the array */
|
|
|
|
ulint n_used; /*!< number of cells currently in use */
|
|
|
|
trx_undo_inf_t* infos; /*!< the array of undo infos */
|
|
|
|
mem_heap_t* heap; /*!< memory heap from which allocated */
|
2005-10-27 07:29:40 +00:00
|
|
|
};
|
|
|
|
|
2009-05-26 12:28:49 +00:00
|
|
|
/** Rollback node states */
|
|
|
|
enum roll_node_state {
|
|
|
|
ROLL_NODE_SEND = 1, /*!< about to send a rollback signal to
|
|
|
|
the transaction */
|
|
|
|
ROLL_NODE_WAIT /*!< rollback signal sent to the transaction,
|
|
|
|
waiting for completion */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Rollback command node in a query graph */
|
2005-10-27 07:29:40 +00:00
|
|
|
struct roll_node_struct{
|
2009-05-26 12:28:49 +00:00
|
|
|
que_common_t common; /*!< node type: QUE_NODE_ROLLBACK */
|
|
|
|
enum roll_node_state state; /*!< node execution state */
|
|
|
|
ibool partial;/*!< TRUE if we want a partial
|
|
|
|
rollback */
|
|
|
|
trx_savept_t savept; /*!< savepoint to which to
|
|
|
|
roll back, in the case of a
|
|
|
|
partial rollback */
|
2005-10-27 07:29:40 +00:00
|
|
|
};
|
|
|
|
|
2009-05-26 12:28:49 +00:00
|
|
|
/** A savepoint set with SQL's "SAVEPOINT savepoint_id" command */
|
2005-10-27 07:29:40 +00:00
|
|
|
struct trx_named_savept_struct{
|
2009-05-26 12:28:49 +00:00
|
|
|
char* name; /*!< savepoint name */
|
|
|
|
trx_savept_t savept; /*!< the undo number corresponding to
|
2005-10-27 07:29:40 +00:00
|
|
|
the savepoint */
|
2008-03-17 14:19:04 +00:00
|
|
|
ib_int64_t mysql_binlog_cache_pos;
|
2009-05-26 12:28:49 +00:00
|
|
|
/*!< the MySQL binlog cache position
|
2005-10-27 07:29:40 +00:00
|
|
|
corresponding to this savepoint, not
|
|
|
|
defined if the MySQL binlogging is not
|
|
|
|
enabled */
|
|
|
|
UT_LIST_NODE_T(trx_named_savept_t)
|
2009-05-26 12:28:49 +00:00
|
|
|
trx_savepoints; /*!< the list of savepoints of a
|
2005-10-27 07:29:40 +00:00
|
|
|
transaction */
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef UNIV_NONINL
|
|
|
|
#include "trx0roll.ic"
|
|
|
|
#endif
|
|
|
|
|
2006-02-23 19:25:29 +00:00
|
|
|
#endif
|