72#define upd_get_nth_field(update, n) ((update)->fields + (n))
108#ifndef UNIV_HOTBACKUP
121 const ulint *offsets,
148 byte *log_ptr,
mtr_t *mtr);
156 const ulint *offsets,
170 const ulint *offsets,
181 const ulint *offsets,
362 ulint autoinc_field_no);
372 std::ostream &
print(std::ostream &out)
const {
380 std::vector<lob_index_diff_t, mem_heap_allocator<lob_index_diff_t>>;
388 return (obj.
print(out));
425 std::ostream &
print(std::ostream &out)
const {
428 out <<
", m_old_data=nullptr";
463 return (obj.
print(out));
532 std::ostream &
print(std::ostream &out)
const;
546 return (obj.
print(out));
601 if (
table ==
nullptr) {
644 total += bdiff.length();
664 std::ostream &
print(std::ostream &out)
const;
689 return (obj.
print(out));
697#ifndef UNIV_HOTBACKUP
uint32_t page_no_t
Page number.
Definition: api0api.h:46
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
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:66
Class that represents a single change to a column value in partial update of a JSON column.
Definition: table.h:1338
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
A C++ wrapper class to the mem_heap_t routines, so that it can be used as an STL allocator.
Definition: mem0mem.h:356
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:223
dberr_t
Definition: db0err.h:39
Data dictionary global types.
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1156
static int flag
Definition: hp_test1.cc:40
#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:94
void error(const char *format,...)
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:333
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Json_data_extension ext
Definition: backend.cc:50
Query graph global types.
void que_node_t
Definition: que0types.h:41
byte rec_t
Definition: rem0types.h:41
required string type
Definition: replication_group_member_actions.proto:34
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:795
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:560
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:555
std::vector< lob_index_diff_t, mem_heap_allocator< lob_index_diff_t > > Lob_index_diff_vec
Definition: row0upd.h:380
constexpr uint32_t UPD_NODE_MAGIC_N
Definition: row0upd.h:778
std::vector< Lob_diff, mem_heap_allocator< Lob_diff > > Lob_diff_vector
Definition: row0upd.h:460
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:800
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:286
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:786
upd_node_t * upd_node_create(mem_heap_t *heap)
Creates an update node for a query graph.
Definition: row0upd.cc:283
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:789
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:3242
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:792
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:3369
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:784
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:386
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:306
constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE
no record field size will be changed in the update
Definition: row0upd.h:802
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:550
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:392
std::ostream & print(std::ostream &out) const
Definition: row0upd.h:425
const byte * read_offset(const byte *undo_ptr)
Read the offset from the undo record.
Definition: row0upd.h:406
Lob_diff(mem_heap_t *mem_heap)
Constructor.
Definition: row0upd.h:396
const byte * m_old_data
Changes to the LOB data.
Definition: row0upd.h:451
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:457
Lob_index_diff_vec * m_idx_diffs
Changes to the LOB index.
Definition: row0upd.h:454
const byte * read_length(const byte *undo_ptr)
Read the length from the undo record.
Definition: row0upd.h:415
ulint m_length
The length of the modification.
Definition: row0upd.h:448
void set_old_data(const byte *undo_ptr)
Definition: row0upd.h:423
ulint m_offset
The offset within LOB where partial update happened.
Definition: row0upd.h:445
Definition: completion_hash.h:35
Definition: btr0pcur.h:99
Structure for an SQL data field.
Definition: data0data.h:617
dtype_t type
type of data
Definition: data0data.h:624
bool is_virtual() const
Definition: data0data.h:628
Data structure for a foreign key constraint; an example: FOREIGN KEY (A, B) REFERENCES TABLE2 (C,...
Definition: dict0mem.h:1661
Data structure for an index.
Definition: dict0mem.h:1041
Data structure for a database table.
Definition: dict0mem.h:1904
const dict_index_t * first_index() const
Definition: dict0mem.h:2462
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:696
unsigned prtype
precise type; MySQL data type, charset code, flags to indicate nullability, signedness,...
Definition: data0type.h:499
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:210
This structure is used for undo logging of LOB index changes.
Definition: row0upd.h:365
undo_no_t m_modifier_undo_no
Definition: row0upd.h:367
trx_id_t m_modifier_trxid
Definition: row0upd.h:366
std::ostream & print(std::ostream &out) const
Print the current object into the given output stream.
Definition: row0upd.h:372
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Compressed page descriptor.
Definition: page0types.h:201
Definition: que0types.h:51
Definition: que0que.h:242
Prefixes of externally stored columns.
Definition: row0ext.h:95
Select statement node.
Definition: row0sel.h:329
Symbol table node.
Definition: pars0sym.h:113
Definition: trx0trx.h:675
Definition: row0upd.h:467
unsigned orig_len
original length of the locally stored part of an externally stored column, or 0
Definition: row0upd.h:491
dfield_t new_val
new value for the column
Definition: row0upd.h:499
undo_no_t last_undo_no
The last stmt within trx that modified the LOB.
Definition: row0upd.h:530
bool ext_in_old
If true, the field was stored externally in the old row.
Definition: row0upd.h:505
unsigned field_no
field number in an index, usually the clustered index, but in updating a secondary index record in bt...
Definition: row0upd.h:484
trx_id_t last_trx_id
The last trx that modified the LOB.
Definition: row0upd.h:527
void push_lob_diff(const Lob_diff &lob_diff)
Definition: row0upd.h:507
page_no_t lob_first_page_no
The LOB first page number.
Definition: row0upd.h:522
upd_field_t()
Definition: row0upd.h:468
dfield_t old_val
old value for the column
Definition: row0upd.h:498
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3343
Field * mysql_field
the mysql field object.
Definition: row0upd.h:502
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:542
que_node_t * exp
expression for calculating a new value: it refers to column values and constants in the symbol table ...
Definition: row0upd.h:494
Lob_diff_vector * lob_diffs
List of changes done to this updated field.
Definition: row0upd.h:518
uint16_t field_phy_pos
Definition: row0upd.h:490
bool is_virtual() const
Definition: row0upd.h:482
ulint lob_version
Definition: row0upd.h:524
dfield_t * old_v_val
old value for the virtual column
Definition: row0upd.h:500
void reset()
Empty the information collected on LOB diffs.
Definition: row0upd.h:535
Definition: row0upd.h:701
bool in_mysql_interface
Definition: row0upd.h:707
sym_node_list_t columns
Definition: row0upd.h:734
sym_node_t * table_sym
Definition: row0upd.h:762
dtuple_t * upd_row
Definition: row0upd.h:755
ulint update_n_fields
Definition: row0upd.h:729
dict_foreign_t * foreign
Definition: row0upd.h:710
dict_index_t * index
NULL, or the next index whose record should be updated.
Definition: row0upd.h:748
row_ext_t * ext
NULL, or prefixes of the externally stored columns in the old row.
Definition: row0upd.h:753
mem_heap_t * cascade_heap
NULL or a mem heap where cascade_upd_nodes are created.
Definition: row0upd.h:716
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:769
que_node_t * col_assign_list
Definition: row0upd.h:763
bool searched_update
Definition: row0upd.h:704
ulint state
node execution state
Definition: row0upd.h:747
upd_t * update
update vector for the row
Definition: row0upd.h:728
dict_table_t * table
table where updated
Definition: row0upd.h:727
sel_node_t * select
query graph subtree implementing a base table cursor: the rows returned will be updated
Definition: row0upd.h:719
btr_pcur_t * pcur
persistent cursor placed on the clustered index record which should be updated or deleted; the cursor...
Definition: row0upd.h:722
row_ext_t * upd_ext
Definition: row0upd.h:756
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:750
que_common_t common
node type: QUE_NODE_UPDATE
Definition: row0upd.h:702
bool has_clust_rec_x_lock
Definition: row0upd.h:736
bool is_delete
Definition: row0upd.h:703
ulint magic_n
Definition: row0upd.h:775
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:773
ulint cmpl_info
Definition: row0upd.h:741
mem_heap_t * heap
memory heap used as auxiliary storage; this must be emptied after a successful update
Definition: row0upd.h:758
upd_node_t * cascade_node
Definition: row0upd.h:713
Definition: row0upd.h:565
void append(const upd_field_t &field)
Append an update field to the end of array.
Definition: row0upd.h:596
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:641
bool is_partially_updated(ulint field_no) const
Check if the given field number is partially updated.
Definition: row0upd.cc:3444
mem_heap_t * heap
Heap from which memory allocated.
Definition: row0upd.h:569
void free_per_stmt_heap()
Free the per_stmt_heap.
Definition: row0upd.h:657
bool validate() const
Definition: row0upd.h:617
void empty_per_stmt_heap()
Empty the per_stmt_heap.
Definition: row0upd.h:650
dtuple_t * old_vrow
Pointer to old row, used for virtual column update now.
Definition: row0upd.h:580
upd_field_t * fields
Array of update fields.
Definition: row0upd.h:592
ulint info_bits
New value of info bits to record; default is 0.
Definition: row0upd.h:577
mem_heap_t * per_stmt_heap
Heap from which memory is allocated if required only for current statement.
Definition: row0upd.h:574
const Binary_diff_vector * get_binary_diff_by_field_no(ulint field_no) const
Definition: row0upd.cc:3488
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3359
dict_table_t * table
The table object.
Definition: row0upd.h:583
upd_field_t * get_field_by_field_no(ulint field_no, dict_index_t *index) const
Definition: row0upd.cc:3423
TABLE * mysql_table
The mysql table object.
Definition: row0upd.h:586
bool is_modified(const ulint field_no) const
Determine if the given field_no is modified.
Definition: row0upd.h:600
ulint n_fields
Number of update fields.
Definition: row0upd.h:589
void reset()
Reset the update fields.
Definition: row0upd.h:610
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:3405
Transaction system global type definitions.
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:142
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
ib_id_t roll_ptr_t
Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR)
Definition: trx0types.h:140
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
unsigned long int ulint
Definition: univ.i:406
#define ut_error
Abort execution.
Definition: ut0dbg.h:101
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
#define ut_o(EXPR)
Opposite of ut_d().
Definition: ut0dbg.h:109
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:107
int n
Definition: xcom_base.cc:509