71#define upd_get_nth_field(update, n) ((update)->fields + (n))
107#ifndef UNIV_HOTBACKUP
120 const ulint *offsets,
147 byte *log_ptr,
mtr_t *mtr);
155 const ulint *offsets,
169 const ulint *offsets,
180 const ulint *offsets,
361 ulint autoinc_field_no);
371 std::ostream &
print(std::ostream &out)
const {
379 std::vector<lob_index_diff_t, mem_heap_allocator<lob_index_diff_t>>;
387 return (obj.
print(out));
424 std::ostream &
print(std::ostream &out)
const {
427 out <<
", m_old_data=nullptr";
462 return (obj.
print(out));
531 std::ostream &
print(std::ostream &out)
const;
545 return (obj.
print(out));
600 if (
table ==
nullptr) {
643 total += bdiff.length();
663 std::ostream &
print(std::ostream &out)
const;
688 return (obj.
print(out));
696#ifndef UNIV_HOTBACKUP
uint32_t page_no_t
Page number.
Definition: api0api.h:48
The index tree persistent cursor.
The index tree general types.
constexpr uint32_t BTR_EXTERN_FIELD_REF_SIZE
The size of a reference to data stored on a different page.
Definition: btr0types.h:65
Class that represents a single change to a column value in partial update of a JSON column.
Definition: table.h:1311
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:425
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
A C++ wrapper class to the mem_heap_t routines, so that it can be used as an STL allocator.
Definition: mem0mem.h:355
SQL data field and tuple.
static uint32_t dfield_get_len(const dfield_t *field)
Gets length of field data.
static bool dfield_is_ext(const dfield_t *field)
Determines if a field is externally stored.
static bool dfield_is_multi_value(const dfield_t *field)
Determine if a field is of multi-value type.
constexpr uint32_t DATA_VIRTUAL
Virtual column.
Definition: data0type.h:222
dberr_t
Definition: db0err.h:38
Data dictionary global types.
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1118
static int flag
Definition: hp_test1.cc:39
#define UINT16_MAX
Definition: lexyy.cc:83
Implements the large objects (LOB) module.
static uint32_t mach_read_next_compressed(const byte **b)
Read a 32-bit integer in a compressed form.
static void * mem_heap_alloc(mem_heap_t *heap, ulint n)
Allocates n bytes of memory from a memory heap.
static void mem_heap_free(mem_heap_t *heap)
Frees the space occupied by a memory heap.
static void mem_heap_empty(mem_heap_t *heap)
Empties a memory heap.
static uint update
Definition: myisamlog.cc:93
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:332
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Json_data_extension ext
Definition: backend.cc:50
Query graph global types.
void que_node_t
Definition: que0types.h:40
byte rec_t
Definition: rem0types.h:40
required string type
Definition: replication_group_member_actions.proto:33
Row operation global types.
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,...
Definition: row0upd.cc:832
constexpr uint32_t UPD_NODE_UPDATE_SOME_SEC
secondary index entries should be looked at and updated if an ordering field changed
Definition: row0upd.h:794
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.
Definition: row0upd.cc:680
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.
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 vec...
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.
Definition: row0upd.cc:1656
static void upd_fld_set_virtual_col(upd_field_t *upd_fld)
Definition: row0upd.h:559
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
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 stor...
Definition: row0upd.cc:358
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.
Definition: row0upd.cc:595
static bool upd_fld_is_multi_value_col(const upd_field_t *upd_fld)
Definition: row0upd.h:554
std::vector< lob_index_diff_t, mem_heap_allocator< lob_index_diff_t > > Lob_index_diff_vec
Definition: row0upd.h:379
constexpr uint32_t UPD_NODE_MAGIC_N
Definition: row0upd.h:777
std::vector< Lob_diff, mem_heap_allocator< Lob_diff > > Lob_diff_vector
Definition: row0upd.h:459
constexpr uint32_t UPD_NODE_NO_ORD_CHANGE
no secondary index record will be changed in the update and no ordering field of the clustered index
Definition: row0upd.h:799
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.
Definition: row0upd.cc:1362
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)
Definition: row0upd.h:285
static const upd_field_t * upd_get_field_by_field_no(const upd_t *update, ulint no, bool is_virtual)
Returns a field of an update vector by field_no.
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.
Definition: row0upd.cc:332
constexpr uint32_t UPD_NODE_UPDATE_CLUSTERED
clustered index record should be updated
Definition: row0upd.h:785
upd_node_t * upd_node_create(mem_heap_t *heap)
Creates an update node for a query graph.
Definition: row0upd.cc:282
static upd_t * upd_create(ulint n, mem_heap_t *heap)
Creates an update vector object.
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.
Definition: row0upd.cc:1920
bool row_upd_changes_disowned_external(const upd_t *update)
Returns true if row update contains disowned external fields.
Definition: row0upd.cc:438
constexpr uint32_t UPD_NODE_INSERT_CLUSTERED
Definition: row0upd.h:788
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.
Definition: row0upd.cc:570
que_thr_t * row_upd_step(que_thr_t *thr)
Updates a row in a table.
Definition: row0upd.cc:3241
static upd_field_t * upd_get_nth_field(const upd_t *update, ulint n)
Returns the nth field of an update vector.
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.
Definition: row0upd.cc:1174
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 positio...
Definition: row0upd.cc:550
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 del...
constexpr uint32_t UPD_NODE_UPDATE_ALL_SEC
an ordering field of the clustered index record was changed, or this is a delete operation: should up...
Definition: row0upd.h:791
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.
Definition: row0upd.cc:3368
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.
Definition: row0upd.cc:1706
constexpr uint32_t UPD_NODE_SET_IX_LOCK
execution came to the node from a node above and if the field has_clust_rec_x_lock is false,...
Definition: row0upd.h:783
std::ostream & operator<<(std::ostream &out, const lob_index_diff_t &obj)
Overloading the global output operator to print lob_index_diff_t object.
Definition: row0upd.h:385
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.
Definition: row0upd.cc:305
constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE
no record field size will be changed in the update
Definition: row0upd.h:801
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 ...
Definition: row0upd.cc:757
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.
Definition: row0upd.cc:474
static bool upd_fld_is_virtual_col(const upd_field_t *upd_fld)
Definition: row0upd.h:549
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.
Definition: row0upd.cc:1233
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 tab...
Definition: row0upd.cc:2700
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.
Definition: row0upd.cc:1116
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.
Definition: row0upd.cc:1686
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.
Definition: row0upd.cc:1429
TempTable Table declarations.
The modification done to the LOB.
Definition: row0upd.h:391
std::ostream & print(std::ostream &out) const
Definition: row0upd.h:424
const byte * read_offset(const byte *undo_ptr)
Read the offset from the undo record.
Definition: row0upd.h:405
Lob_diff(mem_heap_t *mem_heap)
Constructor.
Definition: row0upd.h:395
const byte * m_old_data
Changes to the LOB data.
Definition: row0upd.h:450
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:456
Lob_index_diff_vec * m_idx_diffs
Changes to the LOB index.
Definition: row0upd.h:453
const byte * read_length(const byte *undo_ptr)
Read the length from the undo record.
Definition: row0upd.h:414
ulint m_length
The length of the modification.
Definition: row0upd.h:447
void set_old_data(const byte *undo_ptr)
Definition: row0upd.h:422
ulint m_offset
The offset within LOB where partial update happened.
Definition: row0upd.h:444
Definition: completion_hash.h:34
Definition: btr0pcur.h:98
Structure for an SQL data field.
Definition: data0data.h:604
dtype_t type
type of data
Definition: data0data.h:611
bool is_virtual() const
Definition: data0data.h:613
Data structure for a foreign key constraint; an example: FOREIGN KEY (A, B) REFERENCES TABLE2 (C,...
Definition: dict0mem.h:1665
Data structure for an index.
Definition: dict0mem.h:1045
Data structure for a database table.
Definition: dict0mem.h:1908
const dict_index_t * first_index() const
Definition: dict0mem.h:2454
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:681
unsigned prtype
precise type; MySQL data type, charset code, flags to indicate nullability, signedness,...
Definition: data0type.h:498
static const ulint LOB_SMALL_CHANGE_THRESHOLD
If the total number of bytes modified in an LOB, in an update operation, is less than or equal to thi...
Definition: lob0lob.h:209
This structure is used for undo logging of LOB index changes.
Definition: row0upd.h:364
undo_no_t m_modifier_undo_no
Definition: row0upd.h:366
trx_id_t m_modifier_trxid
Definition: row0upd.h:365
std::ostream & print(std::ostream &out) const
Print the current object into the given output stream.
Definition: row0upd.h:371
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:301
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:176
Compressed page descriptor.
Definition: page0types.h:199
Definition: que0types.h:50
Definition: que0que.h:241
Prefixes of externally stored columns.
Definition: row0ext.h:94
Select statement node.
Definition: row0sel.h:328
Symbol table node.
Definition: pars0sym.h:112
Definition: trx0trx.h:685
Definition: row0upd.h:466
unsigned orig_len
original length of the locally stored part of an externally stored column, or 0
Definition: row0upd.h:490
dfield_t new_val
new value for the column
Definition: row0upd.h:498
undo_no_t last_undo_no
The last stmt within trx that modified the LOB.
Definition: row0upd.h:529
bool ext_in_old
If true, the field was stored externally in the old row.
Definition: row0upd.h:504
unsigned field_no
field number in an index, usually the clustered index, but in updating a secondary index record in bt...
Definition: row0upd.h:483
trx_id_t last_trx_id
The last trx that modified the LOB.
Definition: row0upd.h:526
void push_lob_diff(const Lob_diff &lob_diff)
Definition: row0upd.h:506
page_no_t lob_first_page_no
The LOB first page number.
Definition: row0upd.h:521
upd_field_t()
Definition: row0upd.h:467
dfield_t old_val
old value for the column
Definition: row0upd.h:497
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3342
Field * mysql_field
the mysql field object.
Definition: row0upd.h:501
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:541
que_node_t * exp
expression for calculating a new value: it refers to column values and constants in the symbol table ...
Definition: row0upd.h:493
Lob_diff_vector * lob_diffs
List of changes done to this updated field.
Definition: row0upd.h:517
uint16_t field_phy_pos
Definition: row0upd.h:489
bool is_virtual() const
Definition: row0upd.h:481
ulint lob_version
Definition: row0upd.h:523
dfield_t * old_v_val
old value for the virtual column
Definition: row0upd.h:499
void reset()
Empty the information collected on LOB diffs.
Definition: row0upd.h:534
Definition: row0upd.h:700
bool in_mysql_interface
Definition: row0upd.h:706
sym_node_list_t columns
Definition: row0upd.h:733
sym_node_t * table_sym
Definition: row0upd.h:761
dtuple_t * upd_row
Definition: row0upd.h:754
ulint update_n_fields
Definition: row0upd.h:728
dict_foreign_t * foreign
Definition: row0upd.h:709
dict_index_t * index
NULL, or the next index whose record should be updated.
Definition: row0upd.h:747
row_ext_t * ext
NULL, or prefixes of the externally stored columns in the old row.
Definition: row0upd.h:752
mem_heap_t * cascade_heap
NULL or a mem heap where cascade_upd_nodes are created.
Definition: row0upd.h:715
uint32_t del_multi_val_pos
When there is a lock wait error, this remembers current position of the multi-value field,...
Definition: row0upd.h:768
que_node_t * col_assign_list
Definition: row0upd.h:762
bool searched_update
Definition: row0upd.h:703
ulint state
node execution state
Definition: row0upd.h:746
upd_t * update
update vector for the row
Definition: row0upd.h:727
dict_table_t * table
table where updated
Definition: row0upd.h:726
sel_node_t * select
query graph subtree implementing a base table cursor: the rows returned will be updated
Definition: row0upd.h:718
btr_pcur_t * pcur
persistent cursor placed on the clustered index record which should be updated or deleted; the cursor...
Definition: row0upd.h:721
row_ext_t * upd_ext
Definition: row0upd.h:755
dtuple_t * row
NULL, or a copy (also fields copied to heap) of the row to update; this must be reset to NULL after a...
Definition: row0upd.h:749
que_common_t common
node type: QUE_NODE_UPDATE
Definition: row0upd.h:701
bool has_clust_rec_x_lock
Definition: row0upd.h:735
bool is_delete
Definition: row0upd.h:702
ulint magic_n
Definition: row0upd.h:774
uint32_t upd_multi_val_pos
When there is a lock wait error, this remembers current position of the multi-value field,...
Definition: row0upd.h:772
ulint cmpl_info
Definition: row0upd.h:740
mem_heap_t * heap
memory heap used as auxiliary storage; this must be emptied after a successful update
Definition: row0upd.h:757
upd_node_t * cascade_node
Definition: row0upd.h:712
Definition: row0upd.h:564
void append(const upd_field_t &field)
Append an update field to the end of array.
Definition: row0upd.h:595
static size_t get_total_modified_bytes(const Binary_diff_vector &bdv)
Calculate the total number of bytes modified in one BLOB.
Definition: row0upd.h:640
bool is_partially_updated(ulint field_no) const
Check if the given field number is partially updated.
Definition: row0upd.cc:3443
mem_heap_t * heap
Heap from which memory allocated.
Definition: row0upd.h:568
void free_per_stmt_heap()
Free the per_stmt_heap.
Definition: row0upd.h:656
bool validate() const
Definition: row0upd.h:616
void empty_per_stmt_heap()
Empty the per_stmt_heap.
Definition: row0upd.h:649
dtuple_t * old_vrow
Pointer to old row, used for virtual column update now.
Definition: row0upd.h:579
upd_field_t * fields
Array of update fields.
Definition: row0upd.h:591
ulint info_bits
New value of info bits to record; default is 0.
Definition: row0upd.h:576
mem_heap_t * per_stmt_heap
Heap from which memory is allocated if required only for current statement.
Definition: row0upd.h:573
const Binary_diff_vector * get_binary_diff_by_field_no(ulint field_no) const
Definition: row0upd.cc:3487
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3358
dict_table_t * table
The table object.
Definition: row0upd.h:582
upd_field_t * get_field_by_field_no(ulint field_no, dict_index_t *index) const
Definition: row0upd.cc:3422
TABLE * mysql_table
The mysql table object.
Definition: row0upd.h:585
bool is_modified(const ulint field_no) const
Determine if the given field_no is modified.
Definition: row0upd.h:599
ulint n_fields
Number of update fields.
Definition: row0upd.h:588
void reset()
Reset the update fields.
Definition: row0upd.h:609
std::ostream & print_puvect(std::ostream &out, upd_field_t *uf) const
Print the partial update vector (puvect) of the given update field.
Definition: row0upd.cc:3404
Transaction system global type definitions.
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:141
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:137
ib_id_t roll_ptr_t
Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR)
Definition: trx0types.h:139
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:673
unsigned long int ulint
Definition: univ.i:405
#define ut_error
Abort execution.
Definition: ut0dbg.h:64
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:68
#define ut_o(EXPR)
Opposite of ut_d().
Definition: ut0dbg.h:72
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:70
int n
Definition: xcom_base.cc:508