 |
MySQL
8.0.23
Source Code Documentation
|
Go to the documentation of this file.
47 #ifndef UNIV_HOTBACKUP
73 #define upd_get_nth_field(update, n) ((update)->fields + (n))
98 MY_ATTRIBUTE((warn_unused_result));
132 ulint
type, ib_uint64_t val);
147 byte *log_ptr,
mtr_t *mtr);
155 const ulint *offsets,
161 MY_ATTRIBUTE((warn_unused_result));
170 const ulint *offsets,
181 const ulint *offsets,
184 MY_ATTRIBUTE((warn_unused_result));
204 const ulint *offsets,
bool no_sys,
207 MY_ATTRIBUTE((warn_unused_result));
297 bool *non_mv_upd, ulint
flag)
298 MY_ATTRIBUTE((warn_unused_result));
301 #define row_upd_changes_ord_field_binary(index, update, thr, row, ext, \
303 row_upd_changes_ord_field_binary_func(index, update, thr, row, ext, \
306 #define row_upd_changes_ord_field_binary(index, update, thr, row, ext, \
308 row_upd_changes_ord_field_binary_func(index, update, row, ext, non_mv_upd, 0)
321 MY_ATTRIBUTE((warn_unused_result));
362 const ulint *offsets, ulint
pos,
381 ulint autoinc_field_no);
391 std::ostream &
print(std::ostream &out)
const {
399 std::vector<lob_index_diff_t, mem_heap_allocator<lob_index_diff_t>>;
407 return (obj.
print(out));
444 std::ostream &
print(std::ostream &out)
const {
447 out <<
", m_old_data=nullptr";
482 return (obj.
print(out));
550 std::ostream &
print(std::ostream &out)
const;
564 return (obj.
print(out));
568 #define upd_fld_is_virtual_col(upd_fld) \
569 (((upd_fld)->new_val.type.prtype & DATA_VIRTUAL) == DATA_VIRTUAL)
572 #define upd_fld_is_multi_value_col(upd_fld) \
573 (dfield_is_multi_value(&((upd_fld)->new_val)))
576 #define upd_fld_set_virtual_col(upd_fld) \
577 ((upd_fld)->new_val.type.prtype |= DATA_VIRTUAL)
599 if (
table ==
nullptr) {
609 for (ulint i = 0; i <
n_fields; ++i) {
616 for (ulint i = 0; i <
n_fields; ++i) {
642 total += bdiff.length();
647 std::ostream &
print(std::ostream &out)
const;
670 return (obj.
print(out));
679 #ifndef UNIV_HOTBACKUP
760 #define UPD_NODE_MAGIC_N 1579975
763 #define UPD_NODE_SET_IX_LOCK \
769 #define UPD_NODE_UPDATE_CLUSTERED \
772 #define UPD_NODE_INSERT_CLUSTERED \
776 #define UPD_NODE_UPDATE_ALL_SEC \
781 #define UPD_NODE_UPDATE_SOME_SEC \
787 #define UPD_NODE_NO_ORD_CHANGE \
791 #define UPD_NODE_NO_SIZE_CHANGE \
796 #include "row0upd.ic"
Definition: row0upd.h:486
uint32 page_no_t
Page number.
Definition: api0api.h:57
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:1242
ib_id_t roll_ptr_t
Rollback pointer (DB_ROLL_PTR, DATA_ROLL_PTR)
Definition: trx0types.h:146
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:405
bool ext_in_old
If true, the field was stored externally in the old row.
Definition: row0upd.h:523
Definition: sql_class.h:807
mem_heap_t * heap
heap from which memory allocated
Definition: row0upd.h:581
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:711
std::ostream & print(std::ostream &out) const
Definition: row0upd.h:444
ibool 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:1677
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:417
std::vector< lob_index_diff_t, mem_heap_allocator< lob_index_diff_t > > Lob_index_diff_vec
Definition: row0upd.h:399
void row_upd_index_entry_sys_field(dtuple_t *entry, dict_index_t *index, ulint type, ib_uint64_t val)
Sets the trx id or roll ptr field of a clustered index entry.
Definition: row0upd.cc:332
Definition: btr0pcur.h:178
void row_upd_store_row(trx_t *trx, 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
Lob_index_diff_vec * m_idx_diffs
Changes to the LOB index.
Definition: row0upd.h:473
upd_node_t * cascade_node
Definition: row0upd.h:695
A C++ wrapper class to the mem_heap_t routines, so that it can be used as an STL allocator.
Definition: mem0mem.h:392
bool is_modified(const ulint field_no) const
Determine if the given field_no is modified.
Definition: row0upd.h:598
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:148
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:639
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:144
ibool searched_update
Definition: row0upd.h:686
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:66
void row_upd_replace(trx_t *trx, 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:1380
Data structure for a foreign key constraint; an example: FOREIGN KEY (A, B) REFERENCES TABLE2 (C,...
Definition: dict0mem.h:1292
ibool has_clust_rec_x_lock
Definition: row0upd.h:718
row_ext_t * ext
NULL, or prefixes of the externally stored columns in the old row.
Definition: row0upd.h:735
Dialog Client Authentication nullptr
Definition: dialog.cc:353
void reset()
Reset the update fields.
Definition: row0upd.h:608
Data structure for an index.
Definition: dict0mem.h:879
UNIV_INLINE 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...
This structure is used for undo logging of LOB index changes.
Definition: row0upd.h:384
void push_lob_diff(const Lob_diff &lob_diff)
Definition: row0upd.h:525
bool validate() const
Definition: row0upd.h:615
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:169
char * pos
Definition: do_ctype.cc:76
Prefixes of externally stored columns.
Definition: row0ext.h:100
dict_index_t * index
NULL, or the next index whose record should be updated.
Definition: row0upd.h:730
Symbol table node.
Definition: pars0sym.h:112
void row_upd_index_replace_new_col_vals_index_pos(dtuple_t *entry, const dict_index_t *index, const upd_t *update, ibool order_only, mem_heap_t *heap)
Replaces the new column values stored in the update vector to the index entry given.
Definition: row0upd.cc:1125
dberr_t
Definition: db0err.h:38
Data structure for a database table.
Definition: dict0mem.h:1525
Field * mysql_field
the mysql field object.
Definition: row0upd.h:520
mem_heap_t * cascade_heap
NULL or a mem heap where cascade_upd_nodes are created.
Definition: row0upd.h:698
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:332
UNIV_INLINE ib_uint32_t mach_read_next_compressed(const byte **b)
Read a 32-bit integer in a compressed form.
sym_node_list_t columns
Definition: row0upd.h:716
ibool is_delete
Definition: row0upd.h:685
#define BTR_EXTERN_FIELD_REF_SIZE
The size of a reference to data stored on a different page.
Definition: btr0types.h:60
unsigned field_no
field number in an index, usually the clustered index, but in updating a secondary index record in bt...
Definition: row0upd.h:503
The modification done to the LOB.
Definition: row0upd.h:411
byte rec_t
Definition: rem0types.h:39
ulint state
node execution state
Definition: row0upd.h:729
bool is_virtual() const
Definition: row0upd.h:501
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:668
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
Determines if a field is externally stored.
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:343
Compressed page descriptor.
Definition: page0types.h:182
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:3420
int n
Definition: xcom_base.cc:445
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:1183
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:732
upd_field_t * get_field_by_field_no(ulint field_no, dict_index_t *index) const
Definition: row0upd.cc:3438
const dict_index_t * first_index() const
Definition: dict0mem.h:2055
bool row_upd_changes_disowned_external(const upd_t *update)
Returns true if row update contains disowned external fields.
Definition: row0upd.cc:436
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:476
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
Allocates n bytes of memory from a memory heap.
Lob_diff_vector * lob_diffs
List of changes done to this updated field.
Definition: row0upd.h:536
sel_node_t * select
query graph subtree implementing a base table cursor: the rows returned will be updated
Definition: row0upd.h:701
dtuple_t * upd_row
Definition: row0upd.h:737
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:472
ulint magic_n
Definition: row0upd.h:757
dfield_t old_val
old value for the column
Definition: row0upd.h:516
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:556
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:560
unsigned orig_len
original length of the locally stored part of an externally stored column, or 0
Definition: row0upd.h:509
UNIV_INLINE void upd_field_set_field_no(upd_field_t *upd_field, ulint field_no, const dict_index_t *index, trx_t *trx)
Sets an index field number to be updated by an update vector field.
UNIV_INLINE uint32_t dfield_get_len(const dfield_t *field)
Gets length of field data.
que_node_t * exp
expression for calculating a new value: it refers to column values and constants in the symbol table ...
Definition: row0upd.h:512
row_ext_t * upd_ext
Definition: row0upd.h:738
que_thr_t * row_upd_step(que_thr_t *thr)
Updates a row in a table.
Definition: row0upd.cc:3228
bool is_virtual() const
Definition: data0data.h:648
bool is_partially_updated(ulint field_no) const
Check if the given field number is partially updated.
Definition: row0upd.cc:3459
sym_node_t * table_sym
Definition: row0upd.h:744
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:1707
dict_foreign_t * foreign
Definition: row0upd.h:692
upd_field_t * fields
array of update fields
Definition: row0upd.h:590
dict_table_t * table
table where updated
Definition: row0upd.h:709
btr_pcur_t * pcur
persistent cursor placed on the clustered index record which should be updated or deleted; the cursor...
Definition: row0upd.h:704
void que_node_t
Definition: que0types.h:40
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3329
const byte * m_old_data
Changes to the LOB data.
Definition: row0upd.h:470
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:1448
page_no_t lob_first_page_no
The LOB first page number.
Definition: row0upd.h:540
static uint update
Definition: myisamlog.cc:90
trx_id_t last_trx_id
The last trx that modified the LOB.
Definition: row0upd.h:545
Definition: que0types.h:50
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
dict_table_t * table
the table object
Definition: row0upd.h:586
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:820
upd_t * update
update vector for the row
Definition: row0upd.h:710
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
void append(const upd_field_t &field)
Append an update field to the end of array.
Definition: row0upd.h:594
Definition: completion_hash.h:34
ibool 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
ulint lob_version
Definition: row0upd.h:542
void reset()
Empty the information collected on LOB diffs.
Definition: row0upd.h:553
const byte * read_offset(const byte *undo_ptr)
Read the offset from the undo record.
Definition: row0upd.h:425
upd_field_t()
Definition: row0upd.h:487
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:581
const Binary_diff_vector * get_binary_diff_by_field_no(ulint field_no) const
Definition: row0upd.cc:3503
mem_heap_t * heap
memory heap used as auxiliary storage; this must be emptied after a successful update
Definition: row0upd.h:740
std::ostream & print_binary_diff(std::ostream &out, const Binary_diff *bdiff, const dict_table_t *table, const Field *field)
Print the given binary diff into the given output stream.
Definition: row0upd.cc:3391
Select statement node.
Definition: row0sel.h:341
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:1727
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:745
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:755
undo_no_t last_undo_no
The last stmt within trx that modified the LOB.
Definition: row0upd.h:548
dfield_t * old_v_val
old value for the virtual column
Definition: row0upd.h:518
undo_no_t m_modifier_undo_no
Definition: row0upd.h:386
dtuple_t * old_vrow
pointer to old row, used for virtual column update now
Definition: row0upd.h:584
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1137
upd_node_t * upd_node_create(mem_heap_t *heap)
Creates an update node for a query graph.
Definition: row0upd.cc:283
UNIV_INLINE 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.
Definition: row0upd.h:580
UNIV_INLINE 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
Definition: row0upd.h:683
ulint cmpl_info
Definition: row0upd.h:723
Class that represents a single change to a column value in partial update of a JSON column.
Definition: table.h:1281
Lob_diff(mem_heap_t *mem_heap)
Constructor.
Definition: row0upd.h:415
ulint m_offset
The offset within LOB where partial update happened.
Definition: row0upd.h:464
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3345
ibool in_mysql_interface
Definition: row0upd.h:689
UNIV_INLINE upd_t * upd_create(ulint n, mem_heap_t *heap)
Creates an update vector object.
Implements the large objects (LOB) module.
Structure for an SQL data field.
Definition: data0data.h:639
ulint m_length
The length of the modification.
Definition: row0upd.h:467
ulint update_n_fields
Definition: row0upd.h:711
UNIV_INLINE 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...
Definition: que0que.h:251
type
Definition: base.h:36
que_common_t common
node type: QUE_NODE_UPDATE
Definition: row0upd.h:684
que_node_t * col_assign_list
Definition: row0upd.h:745
ib_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:2703
UNIV_INLINE upd_field_t * upd_get_nth_field(const upd_t *update, ulint n)
Returns the nth field of an update vector.
TABLE * mysql_table
the mysql table object
Definition: row0upd.h:587
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:531
std::ostream & print(std::ostream &out) const
Print the current object into the given output stream.
Definition: row0upd.h:391
std::vector< Lob_diff, mem_heap_allocator< Lob_diff > > Lob_diff_vector
Definition: row0upd.h:479
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:751
ulint n_fields
number of update fields
Definition: row0upd.h:589
Definition: trx0trx.h:836
dfield_t new_val
new value for the column
Definition: row0upd.h:517
static int flag
Definition: hp_test1.cc:39
ulint info_bits
new value of info bits to record; default is 0
Definition: row0upd.h:582
trx_id_t m_modifier_trxid
Definition: row0upd.h:385
void set_old_data(const byte *undo_ptr)
Definition: row0upd.h:442
#define false
Definition: config_static.h:43
const byte * read_length(const byte *undo_ptr)
Read the length from the undo record.
Definition: row0upd.h:434