MySQL 8.4.2
Source Code Documentation
row0upd.h File Reference

Update of a row. More...

#include <stack>
#include "btr0types.h"
#include "data0data.h"
#include "dict0types.h"
#include "lob0lob.h"
#include "row0types.h"
#include "table.h"
#include "trx0types.h"
#include "univ.i"
#include "btr0pcur.h"
#include "pars0types.h"
#include "que0types.h"
#include "row0upd.ic"

Go to the source code of this file.

Classes

struct  lob_index_diff_t
 This structure is used for undo logging of LOB index changes. More...
 
struct  Lob_diff
 The modification done to the LOB. More...
 
struct  upd_field_t
 
struct  upd_t
 
struct  upd_node_t
 

Typedefs

using Lob_index_diff_vec = std::vector< lob_index_diff_t, mem_heap_allocator< lob_index_diff_t > >
 
using Lob_diff_vector = std::vector< Lob_diff, mem_heap_allocator< Lob_diff > >
 

Functions

static upd_tupd_create (ulint n, mem_heap_t *heap)
 Creates an update vector object. More...
 
static ulint upd_get_n_fields (const upd_t *update)
 Returns the number of fields in the update vector == number of columns to be updated by an update vector. More...
 
static upd_field_tupd_get_nth_field (const upd_t *update, ulint n)
 Returns the nth field of an update vector. More...
 
static void upd_field_set_field_no (upd_field_t *upd_field, ulint field_no, const dict_index_t *index)
 Sets an index field number to be updated by an update vector field. More...
 
static void upd_field_set_v_field_no (upd_field_t *upd_field, ulint field_no, const dict_index_t *index)
 set field number to a update vector field, marks this field is updated More...
 
static const upd_field_tupd_get_field_by_field_no (const upd_t *update, ulint no, bool is_virtual)
 Returns a field of an update vector by field_no. More...
 
byterow_upd_write_sys_vals_to_log (dict_index_t *index, trx_id_t trx_id, roll_ptr_t roll_ptr, byte *log_ptr, mtr_t *mtr)
 Writes into the redo log the values of trx id and roll ptr and enough info to determine their positions within a clustered index record. More...
 
static void row_upd_rec_sys_fields (rec_t *rec, page_zip_des_t *page_zip, const dict_index_t *index, const ulint *offsets, const trx_t *trx, roll_ptr_t roll_ptr)
 Updates the trx id and roll ptr field in a clustered index record when a row is updated or marked deleted. More...
 
void row_upd_index_entry_sys_field (dtuple_t *entry, dict_index_t *index, ulint type, uint64_t val)
 Sets the trx id or roll ptr field of a clustered index entry. More...
 
upd_node_tupd_node_create (mem_heap_t *heap)
 Creates an update node for a query graph. More...
 
void row_upd_index_write_log (dict_index_t *index, const upd_t *update, byte *log_ptr, mtr_t *mtr)
 Writes to the redo log the new values of the fields occurring in the index. More...
 
bool row_upd_changes_field_size_or_external (const dict_index_t *index, const ulint *offsets, const upd_t *update)
 Returns true if row update changes size of some field in index or if some field to be updated is stored externally in rec or update. More...
 
bool row_upd_changes_disowned_external (const upd_t *update)
 Returns true if row update contains disowned external fields. More...
 
void row_upd_rec_in_place (rec_t *rec, const dict_index_t *index, const ulint *offsets, const upd_t *update, page_zip_des_t *page_zip)
 Replaces the new column values stored in the update vector to the record given. More...
 
upd_trow_upd_build_sec_rec_difference_binary (const rec_t *rec, dict_index_t *index, const ulint *offsets, const dtuple_t *entry, mem_heap_t *heap)
 Builds an update vector from those fields which in a secondary index entry differ from a record that has the equal ordering fields. More...
 
upd_trow_upd_build_difference_binary (dict_index_t *index, const dtuple_t *entry, const rec_t *rec, const ulint *offsets, bool no_sys, trx_t *trx, mem_heap_t *heap, TABLE *mysql_table, dberr_t *error)
 Builds an update vector from those fields, excluding the roll ptr and trx id fields, which in an index entry differ from a record that has the equal ordering fields. More...
 
void row_upd_index_replace_new_col_vals_index_pos (dtuple_t *entry, const dict_index_t *index, const upd_t *update, bool order_only, mem_heap_t *heap)
 Replaces the new column values stored in the update vector to the index entry given. More...
 
void row_upd_index_replace_new_col_vals (dtuple_t *entry, const dict_index_t *index, const upd_t *update, mem_heap_t *heap)
 Replaces the new column values stored in the update vector to the index entry given. More...
 
void row_upd_replace (dtuple_t *row, row_ext_t **ext, const dict_index_t *index, const upd_t *update, mem_heap_t *heap)
 Replaces the new column values stored in the update vector. More...
 
void row_upd_replace_vcol (dtuple_t *row, const dict_table_t *table, const upd_t *update, bool upd_new, dtuple_t *undo_row, const byte *ptr)
 Replaces the virtual column values stored in a dtuple with that of a update vector. More...
 
bool row_upd_changes_ord_field_binary_func (dict_index_t *index, const upd_t *update, const que_thr_t *thr, const dtuple_t *row, const row_ext_t *ext, bool *non_mv_upd, ulint flag)
 Checks if an update vector changes an ordering field of an index record. More...
 
static bool row_upd_changes_ord_field_binary (dict_index_t *index, const upd_t *update, const que_thr_t *thr, const dtuple_t *row, const row_ext_t *ext, bool *non_mv_upd)
 
ulint row_upd_changes_fts_column (dict_table_t *table, upd_field_t *upd_field)
 Checks if an FTS indexed column is affected by an UPDATE. More...
 
bool row_upd_changes_doc_id (dict_table_t *table, upd_field_t *upd_field)
 Checks if an FTS Doc ID column is affected by an UPDATE. More...
 
bool row_upd_changes_some_index_ord_field_binary (const dict_table_t *table, const upd_t *update)
 Checks if an update vector changes an ordering field of an index record. More...
 
void row_upd_store_row (upd_node_t *node, THD *thd, TABLE *mysql_table)
 Stores to the heap the row on which the node->pcur is positioned. More...
 
que_thr_trow_upd_step (que_thr_t *thr)
 Updates a row in a table. More...
 
byterow_upd_parse_sys_vals (const byte *ptr, const byte *end_ptr, ulint *pos, trx_id_t *trx_id, roll_ptr_t *roll_ptr)
 Parses the log data of system field values. More...
 
void row_upd_rec_sys_fields_in_recovery (rec_t *rec, page_zip_des_t *page_zip, const ulint *offsets, ulint pos, trx_id_t trx_id, roll_ptr_t roll_ptr)
 Updates the trx id and roll ptr field in a clustered index record in database recovery. More...
 
byterow_upd_index_parse (const byte *ptr, const byte *end_ptr, mem_heap_t *heap, upd_t **update_out)
 Parses the log data written by row_upd_index_write_log. More...
 
uint64_t row_upd_get_new_autoinc_counter (const upd_t *update, ulint autoinc_field_no)
 Get the new autoinc counter from the update vector when there is an autoinc field defined in this table. More...
 
std::ostream & operator<< (std::ostream &out, const lob_index_diff_t &obj)
 Overloading the global output operator to print lob_index_diff_t object. More...
 
std::ostream & operator<< (std::ostream &out, const Lob_diff &obj)
 
std::ostream & operator<< (std::ostream &out, const upd_field_t &obj)
 
static bool upd_fld_is_virtual_col (const upd_field_t *upd_fld)
 
static bool upd_fld_is_multi_value_col (const upd_field_t *upd_fld)
 
static void upd_fld_set_virtual_col (upd_field_t *upd_fld)
 
std::ostream & print_binary_diff (std::ostream &out, const Binary_diff *bdiff, const dict_table_t *table, const Field *field, bool print_old)
 Print the given binary diff into the given output stream. More...
 
std::ostream & print_binary_diff (std::ostream &out, const Binary_diff *bdiff)
 
std::ostream & operator<< (std::ostream &out, const upd_t &obj)
 
std::ostream & operator<< (std::ostream &out, const Binary_diff_vector &)
 

Variables

constexpr uint32_t UPD_NODE_MAGIC_N = 1579975
 
constexpr uint32_t UPD_NODE_SET_IX_LOCK = 1
 execution came to the node from a node above and if the field has_clust_rec_x_lock is false, we should set an intention x-lock on the table More...
 
constexpr uint32_t UPD_NODE_UPDATE_CLUSTERED = 2
 clustered index record should be updated More...
 
constexpr uint32_t UPD_NODE_INSERT_CLUSTERED = 3
 
constexpr uint32_t UPD_NODE_UPDATE_ALL_SEC = 5
 an ordering field of the clustered index record was changed, or this is a delete operation: should update all the secondary index records More...
 
constexpr uint32_t UPD_NODE_UPDATE_SOME_SEC = 6
 secondary index entries should be looked at and updated if an ordering field changed More...
 
constexpr uint32_t UPD_NODE_NO_ORD_CHANGE = 1
 no secondary index record will be changed in the update and no ordering field of the clustered index More...
 
constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE = 2
 no record field size will be changed in the update More...
 

Detailed Description

Update of a row.

Created 12/27/1996 Heikki Tuuri

Typedef Documentation

◆ Lob_diff_vector

◆ Lob_index_diff_vec

Function Documentation

◆ operator<<() [1/5]

std::ostream & operator<< ( std::ostream &  out,
const Binary_diff_vector  
)
inline

◆ operator<<() [2/5]

std::ostream & operator<< ( std::ostream &  out,
const Lob_diff obj 
)
inline

◆ operator<<() [3/5]

std::ostream & operator<< ( std::ostream &  out,
const lob_index_diff_t obj 
)
inline

Overloading the global output operator to print lob_index_diff_t object.

Parameters
[in,out]outthe output stream.
[in]objthe object to be printed.
Returns
the output stream.

◆ operator<<() [4/5]

std::ostream & operator<< ( std::ostream &  out,
const upd_field_t obj 
)
inline

◆ operator<<() [5/5]

std::ostream & operator<< ( std::ostream &  out,
const upd_t obj 
)
inline

◆ print_binary_diff() [1/2]

std::ostream & print_binary_diff ( std::ostream &  out,
const Binary_diff bdiff 
)

◆ print_binary_diff() [2/2]

std::ostream & print_binary_diff ( std::ostream &  out,
const Binary_diff bdiff,
const dict_table_t table,
const Field field,
bool  print_old 
)

Print the given binary diff into the given output stream.

Parameters
[in]outthe output stream
[in]bdiffbinary diff to be printed.
[in]tablethe table dictionary object.
[in]fieldmysql field object.
[in]print_oldprints old data of the updated field
Returns
the output stream

◆ row_upd_build_difference_binary()

upd_t * row_upd_build_difference_binary ( dict_index_t index,
const dtuple_t entry,
const rec_t rec,
const ulint offsets,
bool  no_sys,
trx_t trx,
mem_heap_t heap,
TABLE mysql_table,
dberr_t error 
)

Builds an update vector from those fields, excluding the roll ptr and trx id fields, which in an index entry differ from a record that has the equal ordering fields.

NOTE: we compare the fields as binary strings!

Parameters
[in]indexclustered index
[in]entryclustered index entry to insert
[in]recclustered index record
[in]offsetsrec_get_offsets(rec,index), or NULL
[in]no_sysskip the system columns DB_TRX_ID and DB_ROLL_PTR
[in]trxtransaction (for diagnostics), or NULL
[in]heapmemory heap from which allocated
[in]mysql_tableNULL, or mysql table object when user thread invokes dml
[out]errorerror number in case of failure
Returns
own: update vector of differing fields, excluding roll ptr and trx id

◆ row_upd_build_sec_rec_difference_binary()

upd_t * row_upd_build_sec_rec_difference_binary ( const rec_t rec,
dict_index_t index,
const ulint offsets,
const dtuple_t entry,
mem_heap_t heap 
)

Builds an update vector from those fields which in a secondary index entry differ from a record that has the equal ordering fields.

NOTE: we compare the fields as binary strings!

Returns
own: update vector of differing fields in: memory heap from which allocated

NOTE: we compare the fields as binary strings!

Returns
own: update vector of differing fields
Parameters
recin: secondary index record
indexin: index
offsetsin: rec_get_offsets(rec, index)
entryin: entry to insert
heapin: memory heap from which allocated

◆ row_upd_changes_disowned_external()

bool row_upd_changes_disowned_external ( const upd_t update)

Returns true if row update contains disowned external fields.

Returns
true if the update contains disowned external fields. in: update vector
true if the update contains disowned external fields.
Parameters
updatein: update vector

◆ row_upd_changes_doc_id()

bool row_upd_changes_doc_id ( dict_table_t table,
upd_field_t upd_field 
)

Checks if an FTS Doc ID column is affected by an UPDATE.

Returns
whether Doc ID column is affected in: field to check
whether the Doc ID column is changed
Parameters
tablein: table
upd_fieldin: field to check

◆ row_upd_changes_field_size_or_external()

bool row_upd_changes_field_size_or_external ( const dict_index_t index,
const ulint offsets,
const upd_t update 
)

Returns true if row update changes size of some field in index or if some field to be updated is stored externally in rec or update.

Returns
true if the update changes the size of some field in index or the field is external in rec or update in: update vector
true if the update changes the size of some field in index or the field is external in rec or update
Parameters
indexin: index
offsetsin: rec_get_offsets(rec, index)
updatein: update vector

◆ row_upd_changes_fts_column()

ulint row_upd_changes_fts_column ( dict_table_t table,
upd_field_t upd_field 
)

Checks if an FTS indexed column is affected by an UPDATE.

Returns
offset within fts_t::indexes if FTS indexed column updated else ULINT_UNDEFINED in: field to check
offset within fts_t::indexes if FTS indexed column updated else ULINT_UNDEFINED
Parameters
tablein: table
upd_fieldin: field to check

◆ row_upd_changes_ord_field_binary()

static bool row_upd_changes_ord_field_binary ( dict_index_t index,
const upd_t update,
const que_thr_t thr,
const dtuple_t row,
const row_ext_t ext,
bool *  non_mv_upd 
)
inlinestatic

◆ row_upd_changes_ord_field_binary_func()

bool row_upd_changes_ord_field_binary_func ( dict_index_t index,
const upd_t update,
const que_thr_t thr,
const dtuple_t row,
const row_ext_t ext,
bool *  non_mv_upd,
ulint  flag 
)

Checks if an update vector changes an ordering field of an index record.

It will also help check if any non-multi-value field on the multi-value index gets updated or not.

This function is fast if the update vector is short or the number of ordering fields in the index is small. Otherwise, this can be quadratic. NOTE: we compare the fields as binary strings!

Parameters
[in]indexindex of the record
[in]updateupdate vector for the row; NOTE: the field numbers in this MUST be clustered index positions!
[in]thrquery thread, or NULL
[in]rowold value of row, or NULL if the row and the data values in update are not known when this function is called, e.g., at compile time
[in]extNULL, or prefixes of the externally stored columns in the old row
[in,out]non_mv_updNULL, or not NULL pointer to get the information about whether any non-multi-value field on the multi-value index gets updated
[in]flagROW_BUILD_NORMAL, ROW_BUILD_FOR_PURGE or ROW_BUILD_FOR_UNDO
Returns
true if update vector changes an ordering field in the index record

◆ row_upd_changes_some_index_ord_field_binary()

bool row_upd_changes_some_index_ord_field_binary ( const dict_table_t table,
const upd_t update 
)

Checks if an update vector changes an ordering field of an index record.

This function is fast if the update vector is short or the number of ordering fields in the index is small. Otherwise, this can be quadratic. NOTE: we compare the fields as binary strings!

Returns
true if update vector may change an ordering field in an index record in: update vector for the row

NOTE: we compare the fields as binary strings!

Returns
true if update vector may change an ordering field in an index record
Parameters
tablein: table
updatein: update vector for the row

◆ row_upd_get_new_autoinc_counter()

uint64_t row_upd_get_new_autoinc_counter ( const upd_t update,
ulint  autoinc_field_no 
)

Get the new autoinc counter from the update vector when there is an autoinc field defined in this table.

Parameters
[in]updateupdate vector for the clustered index
[in]autoinc_field_noautoinc field's order in clustered index
Returns
the new counter if we find it in the update vector, otherwise 0. We don't mind that the new counter happens to be 0, we just care about non-zero counters.

◆ row_upd_index_entry_sys_field()

void row_upd_index_entry_sys_field ( dtuple_t entry,
dict_index_t index,
ulint  type,
uint64_t  val 
)

Sets the trx id or roll ptr field of a clustered index entry.

Parameters
[in,out]entryIndex entry, where the memory buffers for sys fields are already allocated: the function just copies the new values to them
[in]indexClustered index
[in]typeData_trx_id or data_roll_ptr
[in]valValue to write

◆ row_upd_index_parse()

byte * row_upd_index_parse ( const byte ptr,
const byte end_ptr,
mem_heap_t heap,
upd_t **  update_out 
)

Parses the log data written by row_upd_index_write_log.

Returns
log data end or NULL out: update vector
log data end or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
heapin: memory heap where update vector is built
update_outout: update vector

◆ row_upd_index_replace_new_col_vals()

void row_upd_index_replace_new_col_vals ( dtuple_t entry,
const dict_index_t index,
const upd_t update,
mem_heap_t heap 
)

Replaces the new column values stored in the update vector to the index entry given.

Parameters
[in,out]entryIndex entry where replaced; the clustered index record must be covered by a lock or a page latch to prevent deletion (rollback or purge)
[in]indexIndex; note that this may also be a non-clustered index
[in]updateAn update vector built for the clustered index so that the field number in an upd_field is the clustered index position
[in]heapMemory heap for allocating and copying the new values

◆ row_upd_index_replace_new_col_vals_index_pos()

void row_upd_index_replace_new_col_vals_index_pos ( dtuple_t entry,
const dict_index_t index,
const upd_t update,
bool  order_only,
mem_heap_t heap 
)

Replaces the new column values stored in the update vector to the index entry given.

Parameters
[in,out]entryIndex entry where replaced; the clustered index record must be covered by a lock or a page latch to prevent deletion [rollback or purge]
[in]indexIndex; note that this may also be a non-clustered index
[in]updateAn update vector built for the index so that the field number in an upd_field is the index position
[in]order_onlyIf true, limit the replacement to ordering fields of index; note that this does not work for non-clustered indexes.
[in]heapMemory heap for allocating and copying the new values

◆ row_upd_index_write_log()

void row_upd_index_write_log ( dict_index_t index,
const upd_t update,
byte log_ptr,
mtr_t mtr 
)

Writes to the redo log the new values of the fields occurring in the index.

Parameters
[in]indexindex which to be updated
[in]updateupdate vector
[in]log_ptrpointer to mlog buffer: must contain at least MLOG_BUF_MARGIN bytes of free space; the buffer is closed within this function
[in]mtrmtr into whose log to write

◆ row_upd_parse_sys_vals()

byte * row_upd_parse_sys_vals ( const byte ptr,
const byte end_ptr,
ulint pos,
trx_id_t trx_id,
roll_ptr_t roll_ptr 
)

Parses the log data of system field values.

Returns
log data end or NULL out: roll ptr
log data end or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
posout: TRX_ID position in record
trx_idout: trx id
roll_ptrout: roll ptr

◆ row_upd_rec_in_place()

void row_upd_rec_in_place ( rec_t rec,
const dict_index_t index,
const ulint offsets,
const upd_t update,
page_zip_des_t page_zip 
)

Replaces the new column values stored in the update vector to the record given.

No field size changes are allowed. This function is usually invoked on a clustered index. The only use case for a secondary index is row_ins_sec_index_entry_by_modify() or its counterpart in ibuf_insert_to_index_page(). in: compressed page with enough space available, or NULL

No field size changes are allowed. This function is usually invoked on a clustered index. The only use case for a secondary index is row_ins_sec_index_entry_by_modify() or its counterpart in ibuf_insert_to_index_page().

Parameters
recin/out: record where replaced
indexin: the index the record belongs to
offsetsin: array returned by rec_get_offsets()
updatein: update vector
page_zipin: compressed page with enough space available, or NULL

◆ row_upd_rec_sys_fields()

static void row_upd_rec_sys_fields ( rec_t rec,
page_zip_des_t page_zip,
const dict_index_t index,
const ulint offsets,
const trx_t trx,
roll_ptr_t  roll_ptr 
)
inlinestatic

Updates the trx id and roll ptr field in a clustered index record when a row is updated or marked deleted.

Parameters
[in,out]recrecord
[in,out]page_zipcompressed page whose uncompressed part will be updated, or NULL
[in]indexclustered index
[in]offsetsrec_get_offsets(rec, index)
[in]trxtransaction
[in]roll_ptrroll ptr of the undo log record, can be 0 during IMPORT

◆ row_upd_rec_sys_fields_in_recovery()

void row_upd_rec_sys_fields_in_recovery ( rec_t rec,
page_zip_des_t page_zip,
const ulint offsets,
ulint  pos,
trx_id_t  trx_id,
roll_ptr_t  roll_ptr 
)

Updates the trx id and roll ptr field in a clustered index record in database recovery.

Parameters
[in,out]recRecord
[in,out]page_zipCompressed page, or null
[in]offsetsArray returned by rec_get_offsets()
[in]posTrx_id position in rec
[in]trx_idTransaction id
[in]roll_ptrRoll ptr of the undo log record

◆ row_upd_replace()

void row_upd_replace ( dtuple_t row,
row_ext_t **  ext,
const dict_index_t index,
const upd_t update,
mem_heap_t heap 
)

Replaces the new column values stored in the update vector.

Parameters
[in,out]rowRow where replaced, indexed by col_no; the clustered index record must be covered by a lock or a page latch to prevent deletion (rollback or purge)
[in,out]extNull, or externally stored column prefixes
[in]indexClustered index
[in]updateAn update vector built for the clustered index
[in]heapMemory heap

◆ row_upd_replace_vcol()

void row_upd_replace_vcol ( dtuple_t row,
const dict_table_t table,
const upd_t update,
bool  upd_new,
dtuple_t undo_row,
const byte ptr 
)

Replaces the virtual column values stored in a dtuple with that of a update vector.

Parameters
[in,out]rowdtuple whose column to be updated
[in]tabletable
[in]updatean update vector built for the clustered index
[in]upd_newupdate to new or old value
[in,out]undo_rowundo row (if needs to be updated)
[in]ptrremaining part in update undo log

◆ row_upd_step()

que_thr_t * row_upd_step ( que_thr_t thr)

Updates a row 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

◆ row_upd_store_row()

void row_upd_store_row ( upd_node_t node,
THD thd,
TABLE mysql_table 
)

Stores to the heap the row on which the node->pcur is positioned.

Parameters
[in]noderow update node
[in]thdmysql thread handle
[in,out]mysql_tableNULL, or mysql table object when user thread invokes dml

◆ row_upd_write_sys_vals_to_log()

byte * row_upd_write_sys_vals_to_log ( dict_index_t index,
trx_id_t  trx_id,
roll_ptr_t  roll_ptr,
byte log_ptr,
mtr_t mtr 
)

Writes into the redo log the values of trx id and roll ptr and enough info to determine their positions within a clustered index record.

Parameters
[in]indexClustered index.
[in]trx_idTransaction ID.
[in]roll_ptrRoll ptr of the undo log record.
[in]log_ptrPointer to a buffer of size > 20 opened in mlog.
[in]mtrMini-transaction.
Returns
new pointer to mlog

◆ upd_create()

static upd_t * upd_create ( ulint  n,
mem_heap_t heap 
)
inlinestatic

Creates an update vector object.

Parameters
[in]nnumber of fields
[in]heapheap from which memory allocated
Returns
own: update vector object

◆ upd_field_set_field_no()

static void upd_field_set_field_no ( upd_field_t upd_field,
ulint  field_no,
const dict_index_t index 
)
inlinestatic

Sets an index field number to be updated by an update vector field.

Parameters
[in]upd_fieldupdate vector field
[in]field_nofield number in a clustered index
[in]indexindex

◆ upd_field_set_v_field_no()

static void upd_field_set_v_field_no ( upd_field_t upd_field,
ulint  field_no,
const dict_index_t index 
)
inlinestatic

set field number to a update vector field, marks this field is updated

Parameters
[in,out]upd_fieldupdate vector field
[in]field_novirtual column sequence num
[in]indexindex

◆ upd_fld_is_multi_value_col()

static bool upd_fld_is_multi_value_col ( const upd_field_t upd_fld)
inlinestatic

◆ upd_fld_is_virtual_col()

static bool upd_fld_is_virtual_col ( const upd_field_t upd_fld)
inlinestatic

◆ upd_fld_set_virtual_col()

static void upd_fld_set_virtual_col ( upd_field_t upd_fld)
inlinestatic

◆ upd_get_field_by_field_no()

static const upd_field_t * upd_get_field_by_field_no ( const upd_t update,
ulint  no,
bool  is_virtual 
)
inlinestatic

Returns a field of an update vector by field_no.

Parameters
[in]updateUpdate vector.
[in]noField no.
[in]is_virtualIf it is a virtual column.
Returns
update vector field, or nullptr.

◆ upd_get_n_fields()

static ulint upd_get_n_fields ( const upd_t update)
inlinestatic

Returns the number of fields in the update vector == number of columns to be updated by an update vector.

Returns
number of fields in: update vector

◆ upd_get_nth_field()

static upd_field_t * upd_get_nth_field ( const upd_t update,
ulint  n 
)
inlinestatic

Returns the nth field of an update vector.

Parameters
[in]updateupdate vector
[in]nfield position in update vector
Returns
update vector field

◆ upd_node_create()

upd_node_t * upd_node_create ( mem_heap_t heap)

Creates an update node for a query graph.

Returns
own: update node in: mem heap where created
own: update node
Parameters
heapin: mem heap where created

Variable Documentation

◆ UPD_NODE_INSERT_CLUSTERED

constexpr uint32_t UPD_NODE_INSERT_CLUSTERED = 3
constexpr

◆ UPD_NODE_MAGIC_N

constexpr uint32_t UPD_NODE_MAGIC_N = 1579975
constexpr

◆ UPD_NODE_NO_ORD_CHANGE

constexpr uint32_t UPD_NODE_NO_ORD_CHANGE = 1
constexpr

no secondary index record will be changed in the update and no ordering field of the clustered index

◆ UPD_NODE_NO_SIZE_CHANGE

constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE = 2
constexpr

no record field size will be changed in the update

◆ UPD_NODE_SET_IX_LOCK

constexpr uint32_t UPD_NODE_SET_IX_LOCK = 1
constexpr

execution came to the node from a node above and if the field has_clust_rec_x_lock is false, we should set an intention x-lock on the table

◆ UPD_NODE_UPDATE_ALL_SEC

constexpr uint32_t UPD_NODE_UPDATE_ALL_SEC = 5
constexpr

an ordering field of the clustered index record was changed, or this is a delete operation: should update all the secondary index records

◆ UPD_NODE_UPDATE_CLUSTERED

constexpr uint32_t UPD_NODE_UPDATE_CLUSTERED = 2
constexpr

clustered index record should be updated

◆ UPD_NODE_UPDATE_SOME_SEC

constexpr uint32_t UPD_NODE_UPDATE_SOME_SEC = 6
constexpr

secondary index entries should be looked at and updated if an ordering field changed