MySQL 8.0.40
Source Code Documentation
|
Update of a row. More...
#include <sys/types.h>
#include "dict0dict.h"
#include "ha_prototypes.h"
#include "my_byteorder.h"
#include "my_dbug.h"
#include "rem0rec.h"
#include "row0upd.h"
#include "trx0undo.h"
#include <algorithm>
#include <debug_sync.h>
#include "btr0btr.h"
#include "btr0cur.h"
#include "buf0lru.h"
#include "current_thd.h"
#include "dict0boot.h"
#include "dict0crea.h"
#include "eval0eval.h"
#include "fts0fts.h"
#include "fts0types.h"
#include "lob0lob.h"
#include "lock0lock.h"
#include "log0chkp.h"
#include "mach0data.h"
#include "pars0sym.h"
#include "que0que.h"
#include "rem0cmp.h"
#include "row0ext.h"
#include "row0ins.h"
#include "row0log.h"
#include "row0row.h"
#include "row0sel.h"
#include "trx0rec.h"
#include "dict0dd.h"
Functions | |
static bool | row_upd_changes_first_fields_binary (dtuple_t *entry, dict_index_t *index, const upd_t *update, ulint n) |
Checks if an update vector changes some of the first ordering fields of an index record. More... | |
static bool | row_upd_index_is_referenced (dict_index_t *index) |
Checks if index currently is mentioned as a referenced index in a foreign key constraint. More... | |
static dberr_t | row_upd_check_references_constraints (upd_node_t *node, btr_pcur_t *pcur, dict_table_t *table, dict_index_t *index, ulint *offsets, que_thr_t *thr, mtr_t *mtr) |
Checks if possible foreign key constraints hold after a delete of the record under pcur. More... | |
upd_node_t * | upd_node_create (mem_heap_t *heap) |
Creates an update node for a query graph. 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... | |
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... | |
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... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. More... | |
static byte * | row_upd_ext_fetch (dict_index_t *clust_index, const byte *data, ulint local_len, const page_size_t &page_size, ulint *len, bool is_sdi, mem_heap_t *heap) |
Fetch a prefix of an externally stored column. More... | |
static void | row_upd_index_replace_new_col_val_func (const dict_index_t *index, dfield_t *dfield, const dict_field_t *field, const dict_col_t *col, const upd_field_t *uf, mem_heap_t *heap, bool is_sdi, const page_size_t &page_size) |
Replaces the new column value stored in the update vector in the given index entry field. More... | |
static void | row_upd_index_replace_new_col_val (const dict_index_t *index, dfield_t *dfield, const dict_field_t *field, const dict_col_t *col, const upd_field_t *uf, mem_heap_t *heap, bool is_sdi, const page_size_t &page_size) |
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... | |
static void | row_upd_set_vcol_data (dtuple_t *row, const byte *field, ulint len, dict_v_col_t *vcol) |
Replaces the virtual 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... | |
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... | |
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... | |
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... | |
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... | |
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... | |
static void | row_upd_copy_columns (rec_t *rec, const ulint *offsets, const dict_index_t *index, sym_node_t *column) |
Copies the column values from a record. More... | |
static void | row_upd_eval_new_vals (upd_t *update) |
Calculates the new values for fields to update. More... | |
static void | row_upd_dup_v_new_vals (const upd_t *update) |
Copies the data pointed to by the new values for virtual fields to update. More... | |
static void | row_upd_store_v_row (upd_node_t *node, const upd_t *update, THD *thd, TABLE *mysql_table) |
Stores to the heap the virtual columns that need for any indexes. 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... | |
static void | srv_mbr_print (const byte *data) |
Print a MBR data from disk. More... | |
static dberr_t | row_upd_del_one_multi_sec_index_entry (dict_index_t *index, dtuple_t *entry, que_thr_t *thr) |
Delete mark a secondary index entry of a row, when the index is built on multi-value field. More... | |
static dberr_t | row_upd_multi_sec_index_entry (upd_node_t *node, que_thr_t *thr, bool non_mv_upd) |
Updates secondary index entries of a row, when the index is built on multi-value field. More... | |
static dberr_t | row_upd_sec_index_entry_low (upd_node_t *node, dtuple_t *old_entry, que_thr_t *thr) |
Updates a secondary index entry of a row. More... | |
static dberr_t | row_upd_sec_index_entry (upd_node_t *node, que_thr_t *thr) |
Updates a secondary index entry of a row. More... | |
static dberr_t | row_upd_del_multi_sec_index_entry (upd_node_t *node, que_thr_t *thr) |
Delete secondary index entries of a row, when the index is built on multi-value field. More... | |
static dberr_t | row_upd_sec_step (upd_node_t *node, que_thr_t *thr) |
Updates the secondary index record if it is changed in the row update or deletes it if this is a delete. More... | |
static bool | row_upd_clust_rec_by_insert_inherit_func (const dict_index_t *index, const rec_t *rec, const ulint *offsets, dtuple_t *entry, const upd_t *update) |
Mark non-updated off-page columns inherited when the primary key is updated. More... | |
static bool | row_upd_clust_rec_by_insert_inherit (const dict_index_t *index, const rec_t *rec, const ulint *offsets, dtuple_t *entry, const upd_t *update) |
static dberr_t | row_upd_clust_rec_by_insert (ulint flags, upd_node_t *node, dict_index_t *index, que_thr_t *thr, bool referenced, mtr_t *mtr) |
Marks the clustered index record deleted and inserts the updated version of the record to the index. 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... | |
static bool | row_upd_check_autoinc_counter (const upd_node_t *node, mtr_t *mtr) |
If the table has autoinc column and the counter is updated to some bigger value, we need to log the new autoinc counter. More... | |
static dberr_t | row_upd_clust_rec (ulint flags, upd_node_t *node, dict_index_t *index, ulint *offsets, mem_heap_t **offsets_heap, que_thr_t *thr, mtr_t *mtr) |
Updates a clustered index record of a row when the ordering fields do not change. More... | |
static dberr_t | row_upd_del_mark_clust_rec (ulint flags, upd_node_t *node, dict_index_t *index, ulint *offsets, que_thr_t *thr, bool referenced, mtr_t *mtr) |
Delete marks a clustered index record. More... | |
static dberr_t | row_upd_clust_step (upd_node_t *node, que_thr_t *const thr) |
Updates the clustered index record. More... | |
static dberr_t | row_upd (upd_node_t *node, que_thr_t *thr) |
Updates the affected index records of a row. More... | |
que_thr_t * | row_upd_step (que_thr_t *thr) |
Updates a row in a table. More... | |
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, Field *fld) |
Update of a row.
Created 12/27/1996 Heikki Tuuri
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.
[in] | out | the output stream |
[in] | bdiff | binary diff to be printed. |
[in] | table | the table dictionary object. |
[in] | field | mysql field object. |
[in] | print_old | prints old data of the updated field |
std::ostream & print_binary_diff | ( | std::ostream & | out, |
const Binary_diff * | bdiff, | ||
Field * | fld | ||
) |
|
static |
Updates the affected index records of a row.
When the control is transferred to this node, we assume that we have a persistent cursor which was on a record, and the position of the cursor is stored in the cursor.
node | in: row update node |
thr | in: query thread |
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!
[in] | index | clustered index |
[in] | entry | clustered index entry to insert |
[in] | rec | clustered index record |
[in] | offsets | rec_get_offsets(rec,index), or NULL |
[in] | no_sys | skip the system columns DB_TRX_ID and DB_ROLL_PTR |
[in] | trx | transaction (for diagnostics), or NULL |
[in] | heap | memory heap from which allocated |
[in] | mysql_table | NULL, or mysql table object when user thread invokes dml |
[out] | error | error number in case of failure |
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!
rec | in: secondary index record |
index | in: index |
offsets | in: rec_get_offsets(rec, index) |
entry | in: entry to insert |
heap | in: memory heap from which allocated |
bool row_upd_changes_disowned_external | ( | const upd_t * | update | ) |
Returns true if row update contains disowned external fields.
update | in: update vector |
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.
table | in: table |
upd_field | in: field to check |
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.
index | in: index |
offsets | in: rec_get_offsets(rec, index) |
update | in: update vector |
|
static |
Checks if an update vector changes some of the first ordering fields of an index record.
This is only used in foreign key checks and we can assume that index does not contain column prefixes.
This is only used in foreign key checks and we can assume that index does not contain column prefixes.
entry | in: old value of index entry |
index | in: index of entry |
update | in: update vector for the row |
n | in: how many first fields to check |
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.
table | in: table |
upd_field | in: field to check |
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!
[in] | index | index of the record |
[in] | update | update vector for the row; NOTE: the field numbers in this MUST be clustered index positions! |
[in] | thr | query thread, or NULL |
[in] | row | old 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] | ext | NULL, or prefixes of the externally stored columns in the old row |
[in,out] | non_mv_upd | NULL, or not NULL pointer to get the information about whether any non-multi-value field on the multi-value index gets updated |
[in] | flag | ROW_BUILD_NORMAL, ROW_BUILD_FOR_PURGE or ROW_BUILD_FOR_UNDO |
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.
NOTE: we compare the fields as binary strings!
table | in: table |
update | in: update vector for the row |
|
static |
If the table has autoinc column and the counter is updated to some bigger value, we need to log the new autoinc counter.
We will use the given mtr to do logging for performance reasons.
[in] | node | Row update node |
[in,out] | mtr | Mini-transaction |
|
static |
Checks if possible foreign key constraints hold after a delete of the record under pcur.
NOTE that this function will temporarily commit mtr and lose the pcur position!
node | in: row update node |
pcur | in: cursor positioned on a record; NOTE: the cursor position is lost in this function! |
table | in: table in question |
index | in: index of the cursor |
offsets | in/out: rec_get_offsets(pcur.rec, index) |
thr | in: query thread |
mtr | in: mtr |
|
static |
Updates a clustered index record of a row when the ordering fields do not change.
flags | in: undo logging and locking flags |
node | in: row update node |
index | in: clustered index |
offsets | in: rec_get_offsets() on node->pcur |
offsets_heap | in/out: memory heap, can be emptied |
thr | in: query thread |
mtr | in: mtr; gets committed here |
|
static |
Marks the clustered index record deleted and inserts the updated version of the record to the index.
This function should be used when the ordering fields of the clustered index record change. This should be quite rare in database applications.
flags | in: undo logging and locking flags |
node | in/out: row update node |
index | in: clustered index of the record |
thr | in: query thread |
referenced | in: true if index may be referenced in a foreign key constraint |
mtr | in/out: mtr; gets committed here |
|
inlinestatic |
|
static |
Mark non-updated off-page columns inherited when the primary key is updated.
We must mark them as inherited in entry, so that they are not freed in a rollback. A limited version of this function used to be called btr_cur_mark_dtuple_inherited_extern().
[in] | index | Index describing record's fields. |
[in] | rec | old record, or NULL |
[in] | offsets | rec_get_offsets(rec), or NULL |
[in,out] | entry | updated entry to be inserted into the clustered index |
[in] | update | update vector |
|
static |
Updates the clustered index record.
node | in: row update node |
thr | in: query thread |
|
inlinestatic |
Copies the column values from a record.
[in] | rec | record in a clustered index |
[in] | offsets | array returned by rec_get_offsets() |
[in] | index | clustered index where record resides |
[in] | column | first column in a column list, or nullptr |
|
static |
Delete marks a clustered index record.
flags | in: undo logging and locking flags |
node | in: row update node |
index | in: clustered index |
offsets | in/out: rec_get_offsets() for the record under the cursor |
thr | in: query thread |
referenced | in: true if index may be referenced in a foreign key constraint |
mtr | in: mtr; gets committed here |
|
inlinestatic |
Delete secondary index entries of a row, when the index is built on multi-value field.
[in,out] | node | row update node |
[in] | thr | query thread |
|
inlinestatic |
Delete mark a secondary index entry of a row, when the index is built on multi-value field.
[in] | index | the multi-value index |
[in] | entry | the entry to handle on the index |
[in] | thr | query thread |
|
static |
Copies the data pointed to by the new values for virtual fields to update.
[in,out] | update | an update vector |
|
inlinestatic |
Calculates the new values for fields to update.
Note that row_upd_copy_columns must have been called first.
update | in/out: update vector |
|
static |
Fetch a prefix of an externally stored column.
This is similar to row_ext_lookup(), but the row_ext_t holds the old values of the column and must not be poisoned with the new values.
[in] | clust_index | the clustered index. |
[in] | data | 'internally' stored part of the field containing also the reference to the external part |
[in] | local_len | length of data, in bytes |
[in] | page_size | BLOB page size |
[in,out] | len | input - length of prefix to fetch; output: fetched length of the prefix |
[in] | is_sdi | true for SDI indexes |
[in,out] | heap | heap where to allocate |
Get the new autoinc counter from the update vector when there is an autoinc field defined in this table.
[in] | update | update vector for the clustered index |
[in] | autoinc_field_no | autoinc field's order in clustered index |
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.
[in,out] | entry | Index entry, where the memory buffers for sys fields are already allocated: the function just copies the new values to them |
[in] | index | Clustered index |
[in] | type | Data_trx_id or data_roll_ptr |
[in] | val | Value to write |
|
static |
Checks if index currently is mentioned as a referenced index in a foreign key constraint.
NOTE that since we do not hold dict_operation_lock when leaving the function, it may be that the referencing table has been dropped when we leave this function: this function is only for heuristic use!
index | in: index |
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.
ptr | in: buffer |
end_ptr | in: buffer end |
heap | in: memory heap where update vector is built |
update_out | out: update vector |
|
inlinestatic |
|
static |
Replaces the new column value stored in the update vector in the given index entry field.
[in] | index | index dictionary object. |
[in,out] | dfield | data field of the index entry |
[in] | field | index field |
[in] | col | field->col |
[in] | uf | update field |
[in,out] | heap | memory heap for allocating and copying the new value |
[in] | is_sdi | true for SDI indexes |
[in] | page_size | page size |
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.
[in,out] | entry | Index entry where replaced; the clustered index record must be covered by a lock or a page latch to prevent deletion (rollback or purge) |
[in] | index | Index; note that this may also be a non-clustered index |
[in] | update | An update vector built for the clustered index so that the field number in an upd_field is the clustered index position |
[in] | heap | Memory heap for allocating and copying the new values |
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.
[in,out] | entry | Index entry where replaced; the clustered index record must be covered by a lock or a page latch to prevent deletion [rollback or purge] |
[in] | index | Index; note that this may also be a non-clustered index |
[in] | update | An update vector built for the index so that the field number in an upd_field is the index position |
[in] | order_only | If true, limit the replacement to ordering fields of index; note that this does not work for non-clustered indexes. |
[in] | heap | Memory heap for allocating and copying the new values |
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.
[in] | index | index which to be updated |
[in] | update | update vector |
[in] | log_ptr | pointer to mlog buffer: must contain at least MLOG_BUF_MARGIN bytes of free space; the buffer is closed within this function |
[in] | mtr | mtr into whose log to write |
|
static |
Updates secondary index entries of a row, when the index is built on multi-value field.
[in,out] | node | row update node |
[in] | thr | query thread |
[in] | non_mv_upd | true if any non-multi-value field on the index gets updated too |
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.
ptr | in: buffer |
end_ptr | in: buffer end |
pos | out: TRX_ID position in record |
trx_id | out: trx id |
roll_ptr | out: roll ptr |
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().
rec | in/out: record where replaced |
index | in: the index the record belongs to |
offsets | in: array returned by rec_get_offsets() |
update | in: update vector |
page_zip | in: compressed page with enough space available, or NULL |
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.
[in,out] | rec | Record |
[in,out] | page_zip | Compressed page, or null |
[in] | offsets | Array returned by rec_get_offsets() |
[in] | pos | Trx_id position in rec |
[in] | trx_id | Transaction id |
[in] | roll_ptr | Roll ptr of the undo log record |
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.
[in,out] | row | Row 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] | ext | Null, or externally stored column prefixes |
[in] | index | Clustered index |
[in] | update | An update vector built for the clustered index |
[in] | heap | Memory heap |
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.
[in,out] | row | dtuple whose column to be updated |
[in] | table | table |
[in] | update | an update vector built for the clustered index |
[in] | upd_new | update to new or old value |
[in,out] | undo_row | undo row (if needs to be updated) |
[in] | ptr | remaining part in update undo log |
|
inlinestatic |
Updates a secondary index entry of a row.
[in] | node | row update node |
[in] | thr | query thread |
|
static |
Updates a secondary index entry of a row.
[in] | node | row update node |
[in] | old_entry | the old entry to search, or nullptr then it has to be created in this function |
[in] | thr | query thread |
|
static |
Updates the secondary index record if it is changed in the row update or deletes it if this is a delete.
node | in: row update node |
thr | in: query thread |
|
static |
Replaces the virtual column values stored in the update vector.
[in,out] | row | row whose column to be set |
[in] | field | data to set |
[in] | len | data length |
[in] | vcol | virtual column info |
Updates a row in a table.
This is a high-level function used in SQL execution graphs.
thr | in: query thread |
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.
[in] | node | row update node |
[in] | thd | mysql thread handle |
[in,out] | mysql_table | NULL, or mysql table object when user thread invokes dml |
|
static |
Stores to the heap the virtual columns that need for any indexes.
[in,out] | node | row update node |
[in,out] | update | an update vector if it is update |
[in] | thd | mysql thread handle |
[in,out] | mysql_table | mysql table object |
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.
[in] | index | Clustered index. |
[in] | trx_id | Transaction ID. |
[in] | roll_ptr | Roll ptr of the undo log record. |
[in] | log_ptr | Pointer to a buffer of size > 20 opened in mlog. |
[in] | mtr | Mini-transaction. |
|
static |
Print a MBR data from disk.
upd_node_t * upd_node_create | ( | mem_heap_t * | heap | ) |
Creates an update node for a query graph.
heap | in: mem heap where created |