MySQL 9.1.0
Source Code Documentation
row0uins.cc File Reference

Fresh insert undo. More...

#include "row0uins.h"
#include "btr0btr.h"
#include "dict0boot.h"
#include "dict0crea.h"
#include "dict0dd.h"
#include "dict0dict.h"
#include "ibuf0ibuf.h"
#include "log0chkp.h"
#include "mach0data.h"
#include "que0que.h"
#include "row0log.h"
#include "row0row.h"
#include "row0undo.h"
#include "row0upd.h"
#include "row0vers.h"
#include "trx0rec.h"
#include "trx0roll.h"
#include "trx0trx.h"
#include "trx0undo.h"

Functions

static dberr_t row_undo_ins_remove_clust_rec (undo_node_t *node)
 Removes a clustered index record. More...
 
static dberr_t row_undo_ins_remove_sec_low (ulint mode, dict_index_t *index, dtuple_t *entry, que_thr_t *thr, undo_node_t *node)
 Removes a secondary index entry if found. More...
 
static dberr_t row_undo_ins_remove_sec (dict_index_t *index, dtuple_t *entry, que_thr_t *thr, undo_node_t *node)
 Removes a secondary index entry from the index if found. More...
 
static void row_undo_ins_parse_undo_rec (undo_node_t *node, THD *thd, MDL_ticket **mdl)
 Parses the row reference and other info in a fresh insert undo record. More...
 
static dberr_t row_undo_ins_remove_multi_sec (dict_index_t *index, undo_node_t *node, que_thr_t *thr, mem_heap_t *heap)
 Removes a secondary index entry from the index, which is built on multi-value field, if found. More...
 
static dberr_t row_undo_ins_remove_sec_rec (undo_node_t *node, que_thr_t *thr)
 Removes secondary index records. More...
 
dberr_t row_undo_ins (undo_node_t *node, que_thr_t *thr)
 Undoes a fresh insert of a row to a table. More...
 

Detailed Description

Fresh insert undo.

Created 2/25/1997 Heikki Tuuri

Function Documentation

◆ row_undo_ins()

dberr_t row_undo_ins ( undo_node_t node,
que_thr_t thr 
)

Undoes a fresh insert of a row to a table.

A fresh insert means that the same clustered index unique key did not have any record, even delete marked, at the time of the insert. InnoDB is eager in a rollback: if it figures out that an index record will be removed in the purge anyway, it will remove it in the rollback.

Returns
DB_SUCCESS or DB_OUT_OF_FILE_SPACE
Parameters
nodein: row undo node
thrin: query thread

◆ row_undo_ins_parse_undo_rec()

static void row_undo_ins_parse_undo_rec ( undo_node_t node,
THD thd,
MDL_ticket **  mdl 
)
static

Parses the row reference and other info in a fresh insert undo record.

Parameters
[in,out]noderow undo node
[in]thdTHD associated with the node
[in,out]mdlMDL ticket or nullptr if unnecessary

◆ row_undo_ins_remove_clust_rec()

static dberr_t row_undo_ins_remove_clust_rec ( undo_node_t node)
static

Removes a clustered index record.

The pcur in node was positioned on the record, now it is detached.

Returns
DB_SUCCESS or DB_OUT_OF_FILE_SPACE
Parameters
nodein: undo node

◆ row_undo_ins_remove_multi_sec()

static dberr_t row_undo_ins_remove_multi_sec ( dict_index_t index,
undo_node_t node,
que_thr_t thr,
mem_heap_t heap 
)
static

Removes a secondary index entry from the index, which is built on multi-value field, if found.

For each value, it tries first optimistic, then pessimistic descent down the tree.

Parameters
[in,out]indexmulti-value index
[in]nodeundo node
[in]thrquery thread
[in,out]heapmemory heap
Returns
DB_SUCCESS or error code

◆ row_undo_ins_remove_sec()

static dberr_t row_undo_ins_remove_sec ( dict_index_t index,
dtuple_t entry,
que_thr_t thr,
undo_node_t node 
)
static

Removes a secondary index entry from the index if found.

Tries first optimistic, then pessimistic descent down the tree.

Parameters
[in]indexindex
[in]entryindex entry to insert
[in]thrquery thread
[in]nodeundo node
Returns
DB_SUCCESS or DB_OUT_OF_FILE_SPACE

◆ row_undo_ins_remove_sec_low()

static dberr_t row_undo_ins_remove_sec_low ( ulint  mode,
dict_index_t index,
dtuple_t entry,
que_thr_t thr,
undo_node_t node 
)
static

Removes a secondary index entry if found.

Parameters
[in]modeBTR_MODIFY_LEAF or BTR_MODIFY_TREE, depending on whether we wish optimistic or pessimistic descent down the index tree
[in]indexindex
[in]entryindex entry to remove
[in]thrquery thread
[in]nodeundo node
Returns
DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE

◆ row_undo_ins_remove_sec_rec()

static dberr_t row_undo_ins_remove_sec_rec ( undo_node_t node,
que_thr_t thr 
)
static

Removes secondary index records.

Returns
DB_SUCCESS or DB_OUT_OF_FILE_SPACE
Parameters
nodein/out: row undo node
thrin: query thread