MySQL 9.0.0
Source Code Documentation
row0undo.h File Reference

Row undo. More...

#include "btr0pcur.h"
#include "btr0types.h"
#include "dict0types.h"
#include "mtr0mtr.h"
#include "que0types.h"
#include "row0types.h"
#include "trx0sys.h"
#include "trx0types.h"
#include "univ.i"
#include "ut0ut.h"

Go to the source code of this file.

Classes

struct  Long_undo_state
 State of long running undo operation for purpose of writing periodic messages to error log. More...
 
struct  undo_node_t
 Undo node structure. More...
 

Enumerations

enum  undo_exec { UNDO_NODE_FETCH_NEXT = 1 , UNDO_NODE_INSERT , UNDO_NODE_MODIFY }
 Execution state of an undo node. More...
 

Functions

void row_convert_impl_to_expl_if_needed (btr_cur_t *cursor, undo_node_t *node)
 Converts an implicit lock on the record to explicit in case of partial rollback. More...
 
undo_node_trow_undo_node_create (trx_t &trx, que_thr_t *parent, mem_heap_t *heap, bool partial_rollback)
 Creates a row undo node to a query graph. More...
 
bool row_undo_search_clust_to_pcur (undo_node_t *node)
 Looks for the clustered index record when node has the row reference. More...
 
que_thr_trow_undo_step (que_thr_t *thr)
 Undoes a row operation in a table. More...
 

Detailed Description

Row undo.

Created 1/8/1997 Heikki Tuuri

Enumeration Type Documentation

◆ undo_exec

enum undo_exec

Execution state of an undo node.

Enumerator
UNDO_NODE_FETCH_NEXT 

we should fetch the next undo log record

UNDO_NODE_INSERT 

undo a fresh insert of a row to a table

UNDO_NODE_MODIFY 

undo a modify operation (DELETE or UPDATE) on a row of a table

Function Documentation

◆ row_convert_impl_to_expl_if_needed()

void row_convert_impl_to_expl_if_needed ( btr_cur_t cursor,
undo_node_t node 
)

Converts an implicit lock on the record to explicit in case of partial rollback.

Parameters
[in]cursorcursor to record
[in]nodeundo node

◆ row_undo_node_create()

undo_node_t * row_undo_node_create ( trx_t trx,
que_thr_t parent,
mem_heap_t heap,
bool  partial_rollback 
)

Creates a row undo node to a query graph.

Parameters
[in]trxtransaction
[in]parentparent node, i.e., a thr node
[in]heapmemory heap where created
[in]partial_rollbacktrue if partial rollback
Returns
undo node

◆ row_undo_search_clust_to_pcur()

bool row_undo_search_clust_to_pcur ( undo_node_t node)

Looks for the clustered index record when node has the row reference.

The pcur in node is used in the search. If found, stores the row to node, and stores the position of pcur, and detaches it. The pcur must be closed by the caller in any case.

Returns
true if found; NOTE the node->pcur must be closed by the caller, regardless of the return value in/out: row undo node

The pcur in node is used in the search. If found, stores the row to node, and stores the position of pcur, and detaches it. The pcur must be closed by the caller in any case.

Returns
true if found; NOTE the node->pcur must be closed by the caller, regardless of the return value
Parameters
nodein/out: row undo node

◆ row_undo_step()

que_thr_t * row_undo_step ( que_thr_t thr)

Undoes a row operation in a table.

This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL in: query thread

This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL
Parameters
thrin: query thread