InnoDB Plugin
1.0
|
#include "univ.i"
#include "trx0trx.h"
#include "trx0types.h"
#include "mtr0mtr.h"
#include "trx0sys.h"
#include "trx0roll.ic"
Go to the source code of this file.
Data Structures | |
struct | trx_undo_inf_t |
struct | trx_undo_arr_t |
struct | roll_node_t |
struct | trx_named_savept_t |
Enumerations | |
enum | roll_node_state { ROLL_NODE_NONE = 0, ROLL_NODE_SEND, ROLL_NODE_WAIT } |
Variables | |
bool | trx_rollback_or_clean_is_active |
Transaction rollback
Created 3/26/1996 Heikki Tuuri
enum roll_node_state |
UNIV_INTERN roll_node_t* roll_node_create | ( | mem_heap_t * | heap | ) |
Creates a rollback command node struct.
Determines if this transaction is rolling back an incomplete transaction in crash recovery.
Releases a named savepoint. Savepoints which were set after this savepoint are deleted.
trx | in: transaction handle |
savepoint_name | in: savepoint name |
UNIV_INTERN trx_undo_rec_t* trx_roll_pop_top_rec_of_trx | ( | trx_t * | trx, |
undo_no_t | limit, | ||
roll_ptr_t * | roll_ptr, | ||
mem_heap_t * | heap | ||
) |
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 of this undo record, it must be released with trx_undo_rec_release.
trx | in: transaction |
limit | in: least undo number we need |
roll_ptr | out: roll pointer to undo record |
UNIV_INTERN void trx_roll_savepoints_free | ( | trx_t * | trx, |
trx_named_savept_t * | savep | ||
) |
Frees savepoint structs starting from savep. in: free all savepoints > this one; if this is NULL, free all savepoints of trx
trx | in: transaction handle |
Rollback a transaction used in MySQL.
trx | in/out: transaction |
Rollback the latest SQL statement for MySQL.
trx | in/out: transaction |
UNIV_INTERN os_thread_ret_t DECLARE_THREAD() trx_rollback_or_clean_all_recovered | ( | void * | arg | ) |
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. Note: this is done in a background thread.
UNIV_INTERN void trx_rollback_or_clean_recovered | ( | ibool | all | ) |
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. in: FALSE=roll back dictionary transactions; TRUE=roll back all non-PREPARED transactions
Performs an execution step for a rollback command node in a query graph.
UNIV_INTERN dberr_t trx_rollback_to_savepoint | ( | trx_t * | trx, |
trx_savept_t * | savept | ||
) |
Rollback a transaction to a given savepoint or do a complete rollback.
trx | in: transaction handle |
savept | in: pointer to savepoint undo number, if partial rollback requested, or NULL for complete rollback |
UNIV_INTERN dberr_t trx_rollback_to_savepoint_for_mysql | ( | trx_t * | trx, |
const char * | savepoint_name, | ||
ib_int64_t * | mysql_binlog_cache_pos | ||
) |
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 row holds a lock where the lock information is carried by the trx id stored in the row, these locks are naturally released in the rollback. Savepoints which were set after this savepoint are deleted.
trx | in: transaction handle |
savepoint_name | in: savepoint name |
mysql_binlog_cache_pos | out: the MySQL binlog cache position corresponding to this savepoint; MySQL needs this information to remove the binlog entries of the queries executed after the savepoint |
UNIV_INTERN dberr_t trx_savepoint_for_mysql | ( | trx_t * | trx, |
const char * | savepoint_name, | ||
ib_int64_t | binlog_cache_pos | ||
) |
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 commit or rollback.
trx | in: transaction handle |
savepoint_name | in: savepoint name |
binlog_cache_pos | in: MySQL binlog cache position corresponding to this connection at the time of the savepoint |
UNIV_INTERN trx_savept_t trx_savept_take | ( | trx_t * | trx | ) |
Returns a transaction savepoint taken at this point in time.
UNIV_INTERN void trx_undo_arr_free | ( | trx_undo_arr_t * | arr | ) |
Frees an undo number array. in: undo number array
UNIV_INLINE trx_undo_inf_t* trx_undo_arr_get_nth_info | ( | trx_undo_arr_t * | arr, |
ulint | n | ||
) |
Returns pointer to nth element in an undo number array.
Returns pointer to nth element in an undo number array.
arr | in: undo number array |
n | in: position |
Releases a reserved undo record. in: undo number
trx | in/out: transaction |
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 function above.
trx | in/out: transaction |