MySQL 8.0.32
Source Code Documentation
row0undo.cc File Reference

Row undo. More...

#include <stddef.h>
#include "fsp0fsp.h"
#include "ha_prototypes.h"
#include "mach0data.h"
#include "que0que.h"
#include "row0mysql.h"
#include "row0row.h"
#include "row0uins.h"
#include "row0umod.h"
#include "row0undo.h"
#include "row0upd.h"
#include "srv0srv.h"
#include "trx0purge.h"
#include "trx0rec.h"
#include "trx0roll.h"
#include "trx0rseg.h"
#include "trx0trx.h"
#include "trx0undo.h"

Functions

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...
 
static dberr_t row_undo (undo_node_t *node, que_thr_t *thr)
 Fetches an undo log record and does the undo for the recorded operation. More...
 
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...
 
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

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()

static dberr_t row_undo ( undo_node_t node,
que_thr_t thr 
)
static

Fetches an undo log record and does the undo for the recorded operation.

If none left, or a partial rollback completed, returns control to the parent node, which is always a query thread node.

Returns
DB_SUCCESS if operation successfully completed, else error code
Parameters
nodein: row undo node
thrin: query thread

◆ 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
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
Parameters
thrin: query thread