MySQL 8.4.7
Source Code Documentation
row0upd.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1996, 2025, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/row0upd.h
29 Update of a row
30
31 Created 12/27/1996 Heikki Tuuri
32 *******************************************************/
33
34#ifndef row0upd_h
35#define row0upd_h
36
37#include <stack>
38#include "btr0types.h"
39#include "data0data.h"
40#include "dict0types.h"
41#include "lob0lob.h"
42#include "row0types.h"
43#include "table.h"
44#include "trx0types.h"
45#include "univ.i"
46
47#include "btr0pcur.h"
48#ifndef UNIV_HOTBACKUP
49#include "pars0types.h"
50#include "que0types.h"
51#endif /* !UNIV_HOTBACKUP */
52
53/** Creates an update vector object.
54@param[in] n number of fields
55@param[in] heap heap from which memory allocated
56@return own: update vector object */
57inline upd_t *upd_create(ulint n, mem_heap_t *heap);
58
59/** Returns the number of fields in the update vector == number of columns
60 to be updated by an update vector.
61 @param[in] update update vector
62 @return number of fields */
63inline ulint upd_get_n_fields(const upd_t *update);
64
65/** Returns the nth field of an update vector.
66@param[in] update update vector
67@param[in] n field position in update vector
68@return update vector field */
70
71/** Returns the nth field of an update vector.
72@param[in] update update vector
73@param[in] n field position in update vector
74@return update vector field */
75inline const upd_field_t *upd_get_nth_field(const upd_t *update, ulint n);
76
77/** Set which index field is updated by an update vector field.
78@param[in] upd_field update vector field
79@param[in] field_no field position in index
80@param[in] index index */
81inline void upd_field_set_field_no(upd_field_t *upd_field, ulint field_no,
82 const dict_index_t *index);
83
84/** Set for which virtual column the value is updated by an update vector
85field.
86@param[in,out] upd_field update vector field
87@param[in] field_no virtual column number in table
88@param[in] index index */
89inline void upd_field_set_v_field_no(upd_field_t *upd_field, ulint field_no,
90 const dict_index_t *index);
91
92/** Returns a field of an update vector by field_no.
93@param[in] update Update vector.
94@param[in] no "Field number" as stored in the update vector:
95 when is_virtual is false the position of the field
96 in the updated index, otherwise the column number
97 of the virtual field in table. @see upd_field::field_no
98@param[in] is_virtual If it is a virtual column.
99@return update vector field, or nullptr. */
100[[nodiscard]] inline const upd_field_t *upd_get_field_by_field_no(
101 const upd_t *update, ulint no, bool is_virtual);
102
103/** Writes into the redo log the values of trx id and roll ptr and enough info
104to determine their positions within a clustered index record.
105@param[in] index Clustered index.
106@param[in] trx_id Transaction ID.
107@param[in] roll_ptr Roll ptr of the undo log record.
108@param[in] log_ptr Pointer to a buffer of size > 20 opened in mlog.
109@param[in] mtr Mini-transaction.
110@return new pointer to mlog */
112 roll_ptr_t roll_ptr, byte *log_ptr,
113 mtr_t *mtr);
114
115#ifndef UNIV_HOTBACKUP
116/** Updates the trx id and roll ptr field in a clustered index record when a
117row is updated or marked deleted.
118@param[in,out] rec record
119@param[in,out] page_zip compressed page whose uncompressed part will
120 be updated, or NULL
121@param[in] index clustered index
122@param[in] offsets rec_get_offsets(rec, index)
123@param[in] trx transaction
124@param[in] roll_ptr roll ptr of the undo log record, can be 0
125 during IMPORT */
126inline void row_upd_rec_sys_fields(rec_t *rec, page_zip_des_t *page_zip,
127 const dict_index_t *index,
128 const ulint *offsets, const trx_t *trx,
129 roll_ptr_t roll_ptr);
130#endif /* !UNIV_HOTBACKUP */
131
132/** Sets the trx id or roll ptr field of a clustered index entry.
133@param[in,out] entry Index entry, where the memory buffers for sys fields are
134already allocated: the function just copies the new values to them
135@param[in] index Clustered index
136@param[in] type Data_trx_id or data_roll_ptr
137@param[in] val Value to write */
139 ulint type, uint64_t val);
140
141/** Creates an update node for a query graph.
142 @return own: update node */
144 mem_heap_t *heap); /*!< in: mem heap where created */
145
146/** Writes to the redo log the new values of the fields occurring in the index.
147@param[in] index index which to be updated
148@param[in] update update vector
149@param[in] log_ptr pointer to mlog buffer: must contain at least
150 MLOG_BUF_MARGIN bytes of free space; the buffer
151 is closed within this function
152@param[in] mtr mtr into whose log to write */
154 byte *log_ptr, mtr_t *mtr);
155
156/** Returns true if row update changes size of some field in index or if some
157 field to be updated is stored externally in rec or update.
158 @return true if the update changes the size of some field in index or
159 the field is external in rec or update */
161 const dict_index_t *index, /*!< in: index */
162 const ulint *offsets, /*!< in: rec_get_offsets(rec, index) */
163 const upd_t *update); /*!< in: update vector */
164/** Returns true if row update contains disowned external fields.
165 @return true if the update contains disowned external fields. */
166[[nodiscard]] bool row_upd_changes_disowned_external(
167 const upd_t *update); /*!< in: update vector */
168/** Replaces the new column values stored in the update vector to the
169 record given. No field size changes are allowed. This function is
170 usually invoked on a clustered index. The only use case for a
171 secondary index is row_ins_sec_index_entry_by_modify() or its
172 counterpart in ibuf_insert_to_index_page(). */
174 rec_t *rec, /*!< in/out: record where replaced */
175 const dict_index_t *index, /*!< in: the index the record belongs to */
176 const ulint *offsets, /*!< in: array returned by rec_get_offsets() */
177 const upd_t *update, /*!< in: update vector */
178 page_zip_des_t *page_zip); /*!< in: compressed page with enough space
179 available, or NULL */
180/** Builds an update vector from those fields which in a secondary index entry
181 differ from a record that has the equal ordering fields. NOTE: we compare
182 the fields as binary strings!
183 @return own: update vector of differing fields */
185 const rec_t *rec, /*!< in: secondary index record */
186 dict_index_t *index, /*!< in: index */
187 const ulint *offsets, /*!< in: rec_get_offsets(rec, index) */
188 const dtuple_t *entry, /*!< in: entry to insert */
189 mem_heap_t *heap); /*!< in: memory heap from which allocated */
190/** Builds an update vector from those fields, excluding the roll ptr and
191trx id fields, which in an index entry differ from a record that has
192the equal ordering fields. NOTE: we compare the fields as binary strings!
193@param[in] index clustered index
194@param[in] entry clustered index entry to insert
195@param[in] rec clustered index record
196@param[in] offsets rec_get_offsets(rec,index), or NULL
197@param[in] no_sys skip the system columns
198 DB_TRX_ID and DB_ROLL_PTR
199@param[in] trx transaction (for diagnostics),
200 or NULL
201@param[in] heap memory heap from which allocated
202@param[in] mysql_table NULL, or mysql table object when
203 user thread invokes dml
204@param[out] error error number in case of failure
205@return own: update vector of differing fields, excluding roll ptr and
206trx id */
208 dict_index_t *index, const dtuple_t *entry, const rec_t *rec,
209 const ulint *offsets, bool no_sys, trx_t *trx, mem_heap_t *heap,
210 TABLE *mysql_table, dberr_t *error);
211
212/** Replaces the new column values stored in the update vector to the index
213 entry given.
214@param[in,out] entry Index entry where replaced; the clustered index record must
215be covered by a lock or a page latch to prevent deletion [rollback or purge]
216@param[in] index Index; note that this may also be a non-clustered index
217@param[in] update An update vector built for the index so that the field number
218in an upd_field is the index position
219@param[in] order_only If true, limit the replacement to ordering fields of
220index; note that this does not work for non-clustered indexes.
221@param[in] heap Memory heap for allocating and copying the new values */
223 const dict_index_t *index,
224 const upd_t *update,
225 bool order_only,
226 mem_heap_t *heap);
227
228/** Replaces the new column values stored in the update vector to the index
229 entry given.
230@param[in,out] entry Index entry where replaced; the clustered index record must
231be covered by a lock or a page latch to prevent deletion (rollback or purge)
232@param[in] index Index; note that this may also be a non-clustered index
233@param[in] update An update vector built for the clustered index so that the
234field number in an upd_field is the clustered index position
235@param[in] heap Memory heap for allocating and copying the new values */
237 const dict_index_t *index,
238 const upd_t *update, mem_heap_t *heap);
239
240/** Replaces the new column values stored in the update vector.
241@param[in,out] row Row where replaced, indexed by col_no; the clustered index
242record must be covered by a lock or a page latch to prevent deletion (rollback
243or purge)
244@param[in,out] ext Null, or externally stored column prefixes
245@param[in] index Clustered index
246@param[in] update An update vector built for the clustered index
247@param[in] heap Memory heap */
248void row_upd_replace(dtuple_t *row, row_ext_t **ext, const dict_index_t *index,
249 const upd_t *update, mem_heap_t *heap);
250
251/** Replaces the virtual column values stored in a dtuple with that of
252a update vector.
253@param[in,out] row dtuple whose column to be updated
254@param[in] table table
255@param[in] update an update vector built for the clustered index
256@param[in] upd_new update to new or old value
257@param[in,out] undo_row undo row (if needs to be updated)
258@param[in] ptr remaining part in update undo log */
260 const upd_t *update, bool upd_new, dtuple_t *undo_row,
261 const byte *ptr);
262
263/** Checks if an update vector changes an ordering field of an index record.
264It will also help check if any non-multi-value field on the multi-value index
265gets updated or not.
266
267This function is fast if the update vector is short or the number of ordering
268fields in the index is small. Otherwise, this can be quadratic.
269NOTE: we compare the fields as binary strings!
270@param[in] index index of the record
271@param[in] update update vector for the row; NOTE: the
272 field numbers in this MUST be clustered index
273 positions!
274@param[in] thr query thread, or NULL
275@param[in] row old value of row, or NULL if the
276 row and the data values in update are not
277 known when this function is called, e.g., at
278 compile time
279@param[in] ext NULL, or prefixes of the externally
280 stored columns in the old row
281@param[in,out] non_mv_upd NULL, or not NULL pointer to get the
282 information about whether any non-multi-value
283 field on the multi-value index gets updated
284@param[in] flag ROW_BUILD_NORMAL, ROW_BUILD_FOR_PURGE or
285 ROW_BUILD_FOR_UNDO
286@return true if update vector changes an ordering field in the index record */
288 dict_index_t *index, const upd_t *update,
289 IF_DEBUG(const que_thr_t *thr, ) const dtuple_t *row, const row_ext_t *ext,
290 bool *non_mv_upd, ulint flag);
291
293 dict_index_t *index, const upd_t *update,
294 const que_thr_t *thr [[maybe_unused]], const dtuple_t *row,
295 const row_ext_t *ext, bool *non_mv_upd) {
297 index, update, IF_DEBUG(thr, ) row, ext, non_mv_upd, 0);
298}
299
300/** Checks if an FTS indexed column is affected by an UPDATE.
301 @param[in] table table
302 @param[in] upd_field clustered index field update
303 @return offset within fts_t::indexes if FTS indexed column updated else
304 ULINT_UNDEFINED */
306/** Checks if an FTS Doc ID column is affected by an UPDATE.
307 @return whether Doc ID column is affected */
308[[nodiscard]] bool row_upd_changes_doc_id(
309 dict_table_t *table, /*!< in: table */
310 upd_field_t *upd_field); /*!< in: field to check */
311/** Checks if an update vector changes an ordering field of an index record.
312 This function is fast if the update vector is short or the number of ordering
313 fields in the index is small. Otherwise, this can be quadratic.
314 NOTE: we compare the fields as binary strings!
315 @return true if update vector may change an ordering field in an index
316 record */
318 const dict_table_t *table, /*!< in: table */
319 const upd_t *update); /*!< in: update vector for the row */
320
321/** Stores to the heap the row on which the node->pcur is positioned.
322@param[in] node row update node
323@param[in] thd mysql thread handle
324@param[in,out] mysql_table NULL, or mysql table object when
325 user thread invokes dml */
326void row_upd_store_row(upd_node_t *node, THD *thd, TABLE *mysql_table);
327
328/** Updates a row in a table. This is a high-level function used
329 in SQL execution graphs.
330 @return query thread to run next or NULL */
331que_thr_t *row_upd_step(que_thr_t *thr); /*!< in: query thread */
332/** Parses the log data of system field values.
333 @return log data end or NULL */
334byte *row_upd_parse_sys_vals(const byte *ptr, /*!< in: buffer */
335 const byte *end_ptr, /*!< in: buffer end */
336 ulint *pos, /*!< out: TRX_ID position in record */
337 trx_id_t *trx_id, /*!< out: trx id */
338 roll_ptr_t *roll_ptr); /*!< out: roll ptr */
339
340/** Updates the trx id and roll ptr field in a clustered index record in
341 database recovery.
342@param[in,out] rec Record
343@param[in,out] page_zip Compressed page, or null
344@param[in] offsets Array returned by rec_get_offsets()
345@param[in] pos Trx_id position in rec
346@param[in] trx_id Transaction id
347@param[in] roll_ptr Roll ptr of the undo log record */
349 const ulint *offsets, ulint pos,
350 trx_id_t trx_id, roll_ptr_t roll_ptr);
351
352/** Parses the log data written by row_upd_index_write_log.
353 @param[in] ptr buffer
354 @param[in] end_ptr buffer end
355 @param[in] heap memory heap where update vector is built
356 @param[out] update_out update vector
357 @param[in] index the index corresponding to the update
358 @return log data end or NULL */
359byte *row_upd_index_parse(const byte *ptr, const byte *end_ptr,
360 mem_heap_t *heap, upd_t **update_out,
361 dict_index_t *index);
362
363/** Get the new autoinc counter from the update vector when there is
364an autoinc field defined in this table.
365@param[in] update update vector for the clustered index
366@param[in] autoinc_field_no autoinc field's order in clustered index
367@return the new counter if we find it in the update vector, otherwise 0.
368We don't mind that the new counter happens to be 0, we just care about
369non-zero counters. */
371 ulint autoinc_field_no);
372
373/** This structure is used for undo logging of LOB index changes. */
377
378 /** Print the current object into the given output stream.
379 @param[in,out] out the output stream.
380 @return the output stream. */
381 std::ostream &print(std::ostream &out) const {
382 out << "[lob_index_diff_t: m_modifier_trxid=" << m_modifier_trxid
383 << ", m_modifier_undo_no=" << m_modifier_undo_no << "]";
384 return (out);
385 }
386};
387
389 std::vector<lob_index_diff_t, mem_heap_allocator<lob_index_diff_t>>;
390
391/** Overloading the global output operator to print lob_index_diff_t object.
392@param[in,out] out the output stream.
393@param[in] obj the object to be printed.
394@return the output stream.*/
395inline std::ostream &operator<<(std::ostream &out,
396 const lob_index_diff_t &obj) {
397 return (obj.print(out));
398}
399
400/** The modification done to the LOB. */
401struct Lob_diff {
402 /** Constructor.
403 @param[in] mem_heap the memory heap in which this object
404 has been created. */
405 Lob_diff(mem_heap_t *mem_heap) : heap(mem_heap) {
406 m_idx_diffs = static_cast<Lob_index_diff_vec *>(
408 new (m_idx_diffs)
410 }
411
412 /** Read the offset from the undo record.
413 @param[in] undo_ptr pointer into the undo log record.
414 @return pointer into the undo log record after offset. */
415 const byte *read_offset(const byte *undo_ptr) {
416 /* Read the offset. */
418 return (undo_ptr);
419 }
420
421 /** Read the length from the undo record.
422 @param[in] undo_ptr pointer into the undo log record.
423 @return pointer into the undo log record after length information. */
424 const byte *read_length(const byte *undo_ptr) {
425 /* Read the length. */
428
429 return (undo_ptr);
430 }
431
432 void set_old_data(const byte *undo_ptr) { m_old_data = undo_ptr; }
433
434 std::ostream &print(std::ostream &out) const {
435 out << "[Lob_diff: offset=" << m_offset << ", length=" << m_length;
436 if (m_old_data == nullptr) {
437 out << ", m_old_data=nullptr";
438 } else {
439 out << ", m_old_data=" << PrintBuffer(m_old_data, m_length);
440 }
441
442 if (m_idx_diffs != nullptr) {
443 for (auto iter = m_idx_diffs->begin(); iter != m_idx_diffs->end();
444 ++iter) {
445 out << *iter;
446 }
447 }
448
449 out << "]";
450 return (out);
451 }
452
453 /** The offset within LOB where partial update happened. */
455
456 /** The length of the modification. */
458
459 /** Changes to the LOB data. */
460 const byte *m_old_data = nullptr;
461
462 /** Changes to the LOB index. */
464
465 /** Memory heap in which this object is allocated. */
467};
468
469using Lob_diff_vector = std::vector<Lob_diff, mem_heap_allocator<Lob_diff>>;
470
471inline std::ostream &operator<<(std::ostream &out, const Lob_diff &obj) {
472 return (obj.print(out));
473}
474
475/* Update vector field */
478 : field_no(0),
479 orig_len(0),
480 exp(nullptr),
483 ext_in_old(false),
486 lob_version(0),
487 last_trx_id(0),
488 last_undo_no(0),
489 heap(nullptr) {}
490
491 bool is_virtual() const { return (new_val.is_virtual()); }
492
493 unsigned field_no : 16; /*!< for non-virtual fields, the field
494 position in an index, usually
495 the clustered index, but in updating
496 a secondary index record in btr0cur.cc
497 this is the position in the secondary
498 index; for virtual fields the number
499 of correcponding virtual column in
500 table metadata */
502 unsigned orig_len : 16; /*!< original length of the locally
503 stored part of an externally stored
504 column, or 0 */
505 que_node_t *exp; /*!< expression for calculating a new
506 value: it refers to column values and
507 constants in the symbol table of the
508 query graph */
509 dfield_t old_val; /*!< old value for the column */
510 dfield_t new_val; /*!< new value for the column */
511 dfield_t *old_v_val; /*!< old value for the virtual column */
512
513 Field *mysql_field; /*!< the mysql field object. */
514
515 /** If true, the field was stored externally in the old row. */
517
518 void push_lob_diff(const Lob_diff &lob_diff) {
519 if (lob_diffs == nullptr) {
520 lob_diffs = static_cast<Lob_diff_vector *>(
523 }
524 lob_diffs->push_back(lob_diff);
525 }
526
527 /** List of changes done to this updated field. This is usually
528 populated from the undo log. */
530
531 /** The LOB first page number. This information is read from
532 the undo log. */
534
536
537 /** The last trx that modified the LOB. */
539
540 /** The last stmt within trx that modified the LOB. */
542
543 std::ostream &print(std::ostream &out) const;
544
545 /** Empty the information collected on LOB diffs. */
546 void reset() {
547 if (lob_diffs != nullptr) {
548 lob_diffs->clear();
549 }
550 }
551
552 /** Memory heap in which this object is allocated. */
554};
555
556inline std::ostream &operator<<(std::ostream &out, const upd_field_t &obj) {
557 return (obj.print(out));
558}
559
560/* check whether an update field is on multi-value virtual column */
561inline bool upd_fld_is_multi_value_col(const upd_field_t *upd_fld) {
562 return dfield_is_multi_value(&upd_fld->new_val);
563}
564
565/* set DATA_VIRTUAL bit on update field to show it is a virtual column */
567 upd_fld->new_val.type.prtype |= DATA_VIRTUAL;
568}
569
570/* Update vector structure */
571struct upd_t {
572 /** Heap from which memory allocated. This is not a new heap, rather
573 will point to other heap. Therefore memory allocated from this heap
574 is released when the pointed heap is freed or emptied. */
576
577 /** Heap from which memory is allocated if required only for current
578 statement. This heap is emtied at the end of statement from inside
579 ha_innobase::end_stmt(). */
581
582 /** New value of info bits to record; default is 0. */
584
585 /** Pointer to old row, used for virtual column update now. */
587
588 /** The table object. */
590
591 /** The mysql table object. */
593
594 /** Number of update fields. */
596
597 /** Array of update fields. */
599
600 /** Capacity of the fields array */
602
603 /** Append an update field to the end of array. If fields array is full, more
604 space is allocated on the heap.
605 @param[in] field an update field */
606 void append(const upd_field_t &field);
607
608 /** Determine if the given field_no is modified.
609 @return true if modified, false otherwise. */
610 bool is_modified(const ulint field_no) const {
611 if (table == nullptr) {
612 ut_d(ut_error);
613 ut_o(return false);
614 }
615
616 return (get_field_by_field_no(field_no, table->first_index()) != nullptr);
617 }
618
619 /** Reset the update fields. */
620 void reset() {
621 for (ulint i = 0; i < n_fields; ++i) {
622 fields[i].reset();
623 }
624 }
625
626#ifdef UNIV_DEBUG
627 void validate() const {
628 for (ulint i = 0; i < n_fields; ++i) {
629 dfield_t *field = &fields[i].new_val;
630 if (dfield_is_ext(field)) {
632 }
633 }
634 }
635
636 void validate_for_index(const dict_index_t *index) const {
637 validate();
638 for (ulint i = 0; i < n_fields; ++i) {
639 const upd_field_t &field = fields[i];
640 ut_a(index->is_clustered() || !field.is_virtual());
641 if (!field.is_virtual()) {
643 } else {
644 ut_a_lt(field.field_no, index->table->n_v_cols);
645 }
646 }
647 }
648#endif // UNIV_DEBUG
649
650 /** Check if the given field number is partially updated.
651 @param[in] field_no the field number.
652 @return true if partially updated, false otherwise. */
653 bool is_partially_updated(ulint field_no) const;
654
656 const dict_index_t *index) const;
657
659
660 /** Calculate the total number of bytes modified in one BLOB.
661 @param[in] bdv the binary diff vector containing all the
662 modifications to one BLOB.
663 @return the total modified bytes. */
665 size_t total = 0;
666 for (const Binary_diff &bdiff : bdv) {
667 total += bdiff.length();
668 }
669 return (total);
670 }
671
672 /** Empty the per_stmt_heap. */
674 if (per_stmt_heap != nullptr) {
676 }
677 }
678
679 /** Free the per_stmt_heap. */
681 if (per_stmt_heap != nullptr) {
683 per_stmt_heap = nullptr;
684 }
685 }
686
687 std::ostream &print(std::ostream &out) const;
688
689 /** Print the partial update vector (puvect) of the given update
690 field.
691 @param[in,out] out the output stream
692 @param[in] uf the updated field.
693 @return the output stream. */
694 std::ostream &print_puvect(std::ostream &out, upd_field_t *uf) const;
695};
696
697#ifdef UNIV_DEBUG
698/** Print the given binary diff into the given output stream.
699@param[in] out the output stream
700@param[in] bdiff binary diff to be printed.
701@param[in] table the table dictionary object.
702@param[in] field mysql field object.
703@param[in] print_old prints old data of the updated field
704@return the output stream */
705std::ostream &print_binary_diff(std::ostream &out, const Binary_diff *bdiff,
706 const dict_table_t *table, const Field *field,
707 bool print_old);
708
709std::ostream &print_binary_diff(std::ostream &out, const Binary_diff *bdiff);
710
711inline std::ostream &operator<<(std::ostream &out, const upd_t &obj) {
712 return (obj.print(out));
713}
714
715inline std::ostream &operator<<(std::ostream &out, const Binary_diff_vector &) {
716 return (out);
717}
718#endif /* UNIV_DEBUG */
719
720#ifndef UNIV_HOTBACKUP
721/* Update node structure which also implements the delete operation
722of a row */
723
725 que_common_t common; /*!< node type: QUE_NODE_UPDATE */
726 bool is_delete; /* true if delete, false if update */
728 /* true if searched update, false if
729 positioned */
731 /* true if the update node was created
732 for the MySQL interface */
733 dict_foreign_t *foreign; /* NULL or pointer to a foreign key
734 constraint if this update node is used in
735 doing an ON DELETE or ON UPDATE operation */
736 upd_node_t *cascade_node; /* NULL or an update node template which
737 is used to implement ON DELETE/UPDATE CASCADE
738 or ... SET NULL for foreign keys. If present,
739 this node updates the child (referencing) table's
740 clustered index */
742 /*!< NULL or a mem heap where cascade_upd_nodes
743 are created.*/
744 sel_node_t *select; /*!< query graph subtree implementing a base
745 table cursor: the rows returned will be
746 updated */
747 btr_pcur_t *pcur; /*!< persistent cursor placed on the clustered
748 index record which should be updated or
749 deleted; the cursor is stored in the graph
750 of 'select' field above, except in the case
751 of the MySQL interface */
752 dict_table_t *table; /*!< table where updated */
753 upd_t *update; /*!< update vector for the row */
755 /* when this struct is used to implement
756 a cascade operation for foreign keys, we store
757 here the size of the buffer allocated for use
758 as the update vector */
759 sym_node_list_t columns; /* symbol table nodes for the columns
760 to retrieve from the table */
762 /* true if the select which retrieves the
763 records to update already sets an x-lock on
764 the clustered record; note that it must always
765 set at least an s-lock */
766 ulint cmpl_info; /* information extracted during query
767 compilation; speeds up execution:
768 UPD_NODE_NO_ORD_CHANGE and
769 UPD_NODE_NO_SIZE_CHANGE, ORed */
770 /*----------------------*/
771 /* Local storage for this graph node */
772 ulint state; /*!< node execution state */
773 dict_index_t *index; /*!< NULL, or the next index whose record should
774 be updated */
775 dtuple_t *row; /*!< NULL, or a copy (also fields copied to
776 heap) of the row to update; this must be reset
777 to NULL after a successful update */
778 row_ext_t *ext; /*!< NULL, or prefixes of the externally
779 stored columns in the old row */
780 dtuple_t *upd_row; /* NULL, or a copy of the updated row */
781 row_ext_t *upd_ext; /* NULL, or prefixes of the externally
782 stored columns in upd_row */
783 mem_heap_t *heap; /*!< memory heap used as auxiliary storage;
784 this must be emptied after a successful
785 update */
786 /*----------------------*/
787 sym_node_t *table_sym; /* table node in symbol table */
789 /* column assignment list */
790
791 /** When there is a lock wait error, this remembers current position of
792 the multi-value field, before which the values have been deleted.
793 This will be used for both DELETE and the delete phase of UPDATE. */
795
796 /** When there is a lock wait error, this remembers current position of
797 the multi-value field, before which the values have been updated. */
799
801};
802
803constexpr uint32_t UPD_NODE_MAGIC_N = 1579975;
804
805/* Node execution states */
806/** execution came to the node from a node above and if the field
807has_clust_rec_x_lock is false, we should set an intention x-lock on the table
808 */
809constexpr uint32_t UPD_NODE_SET_IX_LOCK = 1;
810/** clustered index record should be updated */
811constexpr uint32_t UPD_NODE_UPDATE_CLUSTERED = 2;
812/* clustered index record should be inserted, old record is already delete
813 marked */
814constexpr uint32_t UPD_NODE_INSERT_CLUSTERED = 3;
815/** an ordering field of the clustered index record was changed, or this is a
816 delete operation: should update all the secondary index records */
817constexpr uint32_t UPD_NODE_UPDATE_ALL_SEC = 5;
818/** secondary index entries should be looked at and updated if an ordering field
819 changed */
820constexpr uint32_t UPD_NODE_UPDATE_SOME_SEC = 6;
821
822/* Compilation info flags: these must fit within 2 bits; see trx0rec.h */
823/** no secondary index record will be changed in the update and no ordering
824 field of the clustered index */
825constexpr uint32_t UPD_NODE_NO_ORD_CHANGE = 1;
826/** no record field size will be changed in the update */
827constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE = 2;
828#endif /* !UNIV_HOTBACKUP */
829
830#include "row0upd.ic"
831
832#endif
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:1324
Definition: field.h:575
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
uint16_t dict_index_get_n_fields(const dict_index_t *index)
Gets the number of fields in the internal representation of an index, including fields added by the d...
Definition: dict0dict.ic:667
Data dictionary global types.
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1162
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:52
SQL parser global types.
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:828
void upd_field_set_v_field_no(upd_field_t *upd_field, ulint field_no, const dict_index_t *index)
Set for which virtual column the value is updated by an update vector field.
Definition: row0upd.ic:98
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:820
byte * row_upd_index_parse(const byte *ptr, const byte *end_ptr, mem_heap_t *heap, upd_t **update_out, dict_index_t *index)
Parses the log data written by row_upd_index_write_log.
Definition: row0upd.cc:675
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:1636
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
std::vector< lob_index_diff_t, mem_heap_allocator< lob_index_diff_t > > Lob_index_diff_vec
Definition: row0upd.h:389
constexpr uint32_t UPD_NODE_MAGIC_N
Definition: row0upd.h:803
std::vector< Lob_diff, mem_heap_allocator< Lob_diff > > Lob_diff_vector
Definition: row0upd.h:469
void upd_fld_set_virtual_col(upd_field_t *upd_fld)
Definition: row0upd.h:566
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:825
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:1337
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:292
upd_t * upd_create(ulint n, mem_heap_t *heap)
Creates an update vector object.
Definition: row0upd.ic:43
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
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...
Definition: row0upd.ic:136
constexpr uint32_t UPD_NODE_UPDATE_CLUSTERED
clustered index record should be updated
Definition: row0upd.h:811
upd_node_t * upd_node_create(mem_heap_t *heap)
Creates an update node for a query graph.
Definition: row0upd.cc:283
bool upd_fld_is_multi_value_col(const upd_field_t *upd_fld)
Definition: row0upd.h:561
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:1893
bool row_upd_changes_disowned_external(const upd_t *update)
Returns true if row update contains disowned external fields.
Definition: row0upd.cc:437
constexpr uint32_t UPD_NODE_INSERT_CLUSTERED
Definition: row0upd.h:814
upd_field_t * upd_get_nth_field(upd_t *update, ulint n)
Returns the nth field of an update vector.
Definition: row0upd.ic:76
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:3253
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:1159
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
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:817
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:3380
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:1684
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:809
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:395
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
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.ic:115
constexpr uint32_t UPD_NODE_NO_SIZE_CHANGE
no record field size will be changed in the update
Definition: row0upd.h:827
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: row0upd.ic:63
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:753
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:473
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:1218
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:2673
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:1112
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:1666
void upd_field_set_field_no(upd_field_t *upd_field, ulint field_no, const dict_index_t *index)
Set which index field is updated by an update vector field.
Definition: row0upd.ic:84
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:1404
Update of a row.
TempTable Table declarations.
The modification done to the LOB.
Definition: row0upd.h:401
std::ostream & print(std::ostream &out) const
Definition: row0upd.h:434
const byte * read_offset(const byte *undo_ptr)
Read the offset from the undo record.
Definition: row0upd.h:415
Lob_diff(mem_heap_t *mem_heap)
Constructor.
Definition: row0upd.h:405
const byte * m_old_data
Changes to the LOB data.
Definition: row0upd.h:460
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:466
Lob_index_diff_vec * m_idx_diffs
Changes to the LOB index.
Definition: row0upd.h:463
const byte * read_length(const byte *undo_ptr)
Read the length from the undo record.
Definition: row0upd.h:424
ulint m_length
The length of the modification.
Definition: row0upd.h:457
void set_old_data(const byte *undo_ptr)
Definition: row0upd.h:432
ulint m_offset
The offset within LOB where partial update happened.
Definition: row0upd.h:454
Definition: ut.h:72
Definition: table.h:1407
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:626
Data structure for a foreign key constraint; an example: FOREIGN KEY (A, B) REFERENCES TABLE2 (C,...
Definition: dict0mem.h:1666
Data structure for an index.
Definition: dict0mem.h:1046
bool is_clustered() const
Definition: dict0mem.h:1311
dict_table_t * table
back pointer to table
Definition: dict0mem.h:1060
Data structure for a database table.
Definition: dict0mem.h:1918
unsigned n_v_cols
Number of virtual columns.
Definition: dict0mem.h:2077
const dict_index_t * first_index() const
Definition: dict0mem.h:2476
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:694
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:374
undo_no_t m_modifier_undo_no
Definition: row0upd.h:376
trx_id_t m_modifier_trxid
Definition: row0upd.h:375
std::ostream & print(std::ostream &out) const
Print the current object into the given output stream.
Definition: row0upd.h:381
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:476
unsigned orig_len
original length of the locally stored part of an externally stored column, or 0
Definition: row0upd.h:502
dfield_t new_val
new value for the column
Definition: row0upd.h:510
undo_no_t last_undo_no
The last stmt within trx that modified the LOB.
Definition: row0upd.h:541
bool ext_in_old
If true, the field was stored externally in the old row.
Definition: row0upd.h:516
unsigned field_no
for non-virtual fields, the field position in an index, usually the clustered index,...
Definition: row0upd.h:493
trx_id_t last_trx_id
The last trx that modified the LOB.
Definition: row0upd.h:538
void push_lob_diff(const Lob_diff &lob_diff)
Definition: row0upd.h:518
page_no_t lob_first_page_no
The LOB first page number.
Definition: row0upd.h:533
upd_field_t()
Definition: row0upd.h:477
dfield_t old_val
old value for the column
Definition: row0upd.h:509
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3354
Field * mysql_field
the mysql field object.
Definition: row0upd.h:513
mem_heap_t * heap
Memory heap in which this object is allocated.
Definition: row0upd.h:553
que_node_t * exp
expression for calculating a new value: it refers to column values and constants in the symbol table ...
Definition: row0upd.h:505
Lob_diff_vector * lob_diffs
List of changes done to this updated field.
Definition: row0upd.h:529
uint16_t field_phy_pos
Definition: row0upd.h:501
bool is_virtual() const
Definition: row0upd.h:491
ulint lob_version
Definition: row0upd.h:535
dfield_t * old_v_val
old value for the virtual column
Definition: row0upd.h:511
void reset()
Empty the information collected on LOB diffs.
Definition: row0upd.h:546
Definition: row0upd.h:724
bool in_mysql_interface
Definition: row0upd.h:730
sym_node_list_t columns
Definition: row0upd.h:759
sym_node_t * table_sym
Definition: row0upd.h:787
dtuple_t * upd_row
Definition: row0upd.h:780
ulint update_n_fields
Definition: row0upd.h:754
dict_foreign_t * foreign
Definition: row0upd.h:733
dict_index_t * index
NULL, or the next index whose record should be updated.
Definition: row0upd.h:773
row_ext_t * ext
NULL, or prefixes of the externally stored columns in the old row.
Definition: row0upd.h:778
mem_heap_t * cascade_heap
NULL or a mem heap where cascade_upd_nodes are created.
Definition: row0upd.h:741
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:794
que_node_t * col_assign_list
Definition: row0upd.h:788
bool searched_update
Definition: row0upd.h:727
ulint state
node execution state
Definition: row0upd.h:772
upd_t * update
update vector for the row
Definition: row0upd.h:753
dict_table_t * table
table where updated
Definition: row0upd.h:752
sel_node_t * select
query graph subtree implementing a base table cursor: the rows returned will be updated
Definition: row0upd.h:744
btr_pcur_t * pcur
persistent cursor placed on the clustered index record which should be updated or deleted; the cursor...
Definition: row0upd.h:747
row_ext_t * upd_ext
Definition: row0upd.h:781
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:775
que_common_t common
node type: QUE_NODE_UPDATE
Definition: row0upd.h:725
bool has_clust_rec_x_lock
Definition: row0upd.h:761
bool is_delete
Definition: row0upd.h:726
ulint magic_n
Definition: row0upd.h:800
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:798
ulint cmpl_info
Definition: row0upd.h:766
mem_heap_t * heap
memory heap used as auxiliary storage; this must be emptied after a successful update
Definition: row0upd.h:783
upd_node_t * cascade_node
Definition: row0upd.h:736
Definition: row0upd.h:571
void append(const upd_field_t &field)
Append an update field to the end of array.
Definition: row0upd.cc:2748
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:664
bool is_partially_updated(ulint field_no) const
Check if the given field number is partially updated.
Definition: row0upd.cc:3445
mem_heap_t * heap
Heap from which memory allocated.
Definition: row0upd.h:575
void free_per_stmt_heap()
Free the per_stmt_heap.
Definition: row0upd.h:680
void empty_per_stmt_heap()
Empty the per_stmt_heap.
Definition: row0upd.h:673
dtuple_t * old_vrow
Pointer to old row, used for virtual column update now.
Definition: row0upd.h:586
upd_field_t * fields
Array of update fields.
Definition: row0upd.h:598
const dict_table_t * table
The table object.
Definition: row0upd.h:589
ulint info_bits
New value of info bits to record; default is 0.
Definition: row0upd.h:583
mem_heap_t * per_stmt_heap
Heap from which memory is allocated if required only for current statement.
Definition: row0upd.h:580
void validate_for_index(const dict_index_t *index) const
Definition: row0upd.h:636
void validate() const
Definition: row0upd.h:627
const Binary_diff_vector * get_binary_diff_by_field_no(ulint field_no) const
Definition: row0upd.cc:3490
const upd_field_t * get_field_by_field_no(ulint field_no, const dict_index_t *index) const
Definition: row0upd.cc:3434
std::ostream & print(std::ostream &out) const
Definition: row0upd.cc:3370
TABLE * mysql_table
The mysql table object.
Definition: row0upd.h:592
bool is_modified(const ulint field_no) const
Determine if the given field_no is modified.
Definition: row0upd.h:610
size_t n_capacity
Capacity of the fields array.
Definition: row0upd.h:601
ulint n_fields
Number of update fields.
Definition: row0upd.h:595
void reset()
Reset the update fields.
Definition: row0upd.h:620
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:3416
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_ad_le(LHS, RHS)
Debug-only assertion that LHS <= RHS.
Definition: ut0dbg.h:113
#define ut_o(EXPR)
Opposite of ut_d().
Definition: ut0dbg.h:109
#define ut_a_lt(LHS, RHS)
Assert that LHS < RHS.
Definition: ut0dbg.h:83
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:107
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:93
int n
Definition: xcom_base.cc:509