MySQL 8.4.2
Source Code Documentation
data0data.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1994, 2024, 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/data0data.h
29 SQL data field and tuple
30
31 Created 5/30/1994 Heikki Tuuri
32 *************************************************************************/
33
34#ifndef data0data_h
35#define data0data_h
36
37#include "univ.i"
38
39#include "data0type.h"
40#include "data0types.h"
41#include "dict0types.h"
42#include "mem0mem.h"
43#include "trx0types.h"
44#include "ut0bitset.h"
45
46#include <ostream>
47
48/** Storage for overflow data in a big record, that is, a clustered
49index record which needs external storage of data fields */
50struct big_rec_t;
51struct upd_t;
52
53#ifdef UNIV_DEBUG
54/** Gets pointer to the type struct of SQL data field.
55 @return pointer to the type struct */
56[[nodiscard]] static inline dtype_t *dfield_get_type(
57 const dfield_t *field); /*!< in: SQL data field */
58/** Gets pointer to the data in a field.
59 @return pointer to data */
60[[nodiscard]] static inline void *dfield_get_data(
61 const dfield_t *field); /*!< in: field */
62#else /* UNIV_DEBUG */
63#define dfield_get_type(field) (&(field)->type)
64#define dfield_get_data(field) ((field)->data)
65#endif /* UNIV_DEBUG */
66
67/** Sets the type struct of SQL data field.
68@param[in] field SQL data field
69@param[in] type pointer to data type struct */
70static inline void dfield_set_type(dfield_t *field, const dtype_t *type);
71
72/** Gets length of field data.
73 @return length of data; UNIV_SQL_NULL if SQL null data */
74[[nodiscard]] static inline uint32_t dfield_get_len(
75 const dfield_t *field); /*!< in: field */
76
77/** Sets length in a field.
78@param[in] field field
79@param[in] len length or UNIV_SQL_NULL */
80static inline void dfield_set_len(dfield_t *field, ulint len);
81
82/** Determines if a field is SQL NULL
83 @return nonzero if SQL null data */
84[[nodiscard]] static inline ulint dfield_is_null(
85 const dfield_t *field); /*!< in: field */
86/** Determines if a field is externally stored
87 @return nonzero if externally stored */
88[[nodiscard]] static inline bool dfield_is_ext(
89 const dfield_t *field); /*!< in: field */
90/** Sets the "external storage" flag */
91static inline void dfield_set_ext(dfield_t *field); /*!< in/out: field */
92
93/** Gets spatial status for "external storage"
94@param[in,out] field field */
96
97/** Sets spatial status for "external storage"
98@param[in,out] field field
99@param[in] spatial_status spatial status */
100static inline void dfield_set_spatial_status(dfield_t *field,
101 spatial_status_t spatial_status);
102
103/** Sets pointer to the data and length in a field.
104@param[in] field field
105@param[in] data data
106@param[in] len length or UNIV_SQL_NULL */
107static inline void dfield_set_data(dfield_t *field, const void *data,
108 ulint len);
109
110/** Sets pointer to the data and length in a field.
111@param[in] field field
112@param[in] mbr data */
113static inline void dfield_write_mbr(dfield_t *field, const double *mbr);
114
115/** Sets a data field to SQL NULL. */
116static inline void dfield_set_null(dfield_t *field); /*!< in/out: field */
117
118/** Writes an SQL null field full of zeros.
119@param[in] data pointer to a buffer of size len
120@param[in] len SQL null size in bytes */
121static inline void data_write_sql_null(byte *data, ulint len);
122
123/** Copies the data and len fields.
124@param[out] field1 field to copy to
125@param[in] field2 field to copy from */
126static inline void dfield_copy_data(dfield_t *field1, const dfield_t *field2);
127
128/** Copies a data field to another.
129@param[out] field1 field to copy to
130@param[in] field2 field to copy from */
131static inline void dfield_copy(dfield_t *field1, const dfield_t *field2);
132
133/** Copies the data pointed to by a data field.
134@param[in,out] field data field
135@param[in] heap memory heap where allocated */
136static inline void dfield_dup(dfield_t *field, mem_heap_t *heap);
137
138/** Copies the data pointed to by a data field.
139This function works for multi-value fields only.
140@param[in,out] field data field
141@param[in] heap memory heap where allocated */
142static inline void dfield_multi_value_dup(dfield_t *field, mem_heap_t *heap);
143
144/** Determine if a field is of multi-value type
145@param[in] field data field
146@return true if multi-value type field, otherwise false */
147static inline bool dfield_is_multi_value(const dfield_t *field);
148
149/** Tests if two data fields are equal.
150If len==0, tests the data length and content for equality.
151If len>0, tests the first len bytes of the content for equality.
152@param[in] field1 first field to compare
153@param[in] field2 second field to compare
154@param[in] len maximum prefix to compare,
155 or 0 to compare the whole field length.
156 This works only if !multi_val
157@return true if both fields are NULL or if they are equal */
158[[nodiscard]] inline bool dfield_datas_are_binary_equal(const dfield_t *field1,
159 const dfield_t *field2,
160 ulint len);
161/** Tests if dfield data length and content is equal to the given.
162@param[in] field Field
163@param[in] len Data length or UNIV_SQL_NULL
164@param[in] data Data
165@return true if equal */
166[[nodiscard]] static inline bool dfield_data_is_binary_equal(
167 const dfield_t *field, ulint len, const byte *data);
168/** Gets number of fields in a data tuple.
169 @return number of fields */
170[[nodiscard]] static inline ulint dtuple_get_n_fields(
171 const dtuple_t *tuple); /*!< in: tuple */
172
173/** Gets number of virtual fields in a data tuple.
174@param[in] tuple dtuple to check
175@return number of fields */
176static inline ulint dtuple_get_n_v_fields(const dtuple_t *tuple);
177
178#ifdef UNIV_DEBUG
179/** Gets nth field of a tuple.
180@param[in] tuple tuple
181@param[in] n index of field
182@return nth field */
183static inline dfield_t *dtuple_get_nth_field(const dtuple_t *tuple, ulint n);
184
185/** Gets nth virtual field of a tuple.
186@param[in] tuple tuple
187@param[in] n the nth field to get
188@return nth field */
189static inline dfield_t *dtuple_get_nth_v_field(const dtuple_t *tuple, ulint n);
190
191#else /* UNIV_DEBUG */
192#define dtuple_get_nth_field(tuple, n) ((tuple)->fields + (n))
193#define dtuple_get_nth_v_field(tuple, n) \
194 ((tuple)->fields + (tuple)->n_fields + (n))
195#endif /* UNIV_DEBUG */
196/** Gets info bits in a data tuple.
197 @return info bits */
198[[nodiscard]] static inline ulint dtuple_get_info_bits(
199 const dtuple_t *tuple); /*!< in: tuple */
200
201/** Sets info bits in a data tuple.
202@param[in] tuple tuple
203@param[in] info_bits info bits */
204static inline void dtuple_set_info_bits(dtuple_t *tuple, ulint info_bits);
205
206/** Gets number of fields used in record comparisons.
207 @return number of fields used in comparisons in rem0cmp.* */
208[[nodiscard]] static inline ulint dtuple_get_n_fields_cmp(
209 const dtuple_t *tuple); /*!< in: tuple */
210
211/** Gets number of fields used in record comparisons.
212@param[in] tuple tuple
213@param[in] n_fields_cmp number of fields used in comparisons in
214 rem0cmp */
215static inline void dtuple_set_n_fields_cmp(dtuple_t *tuple, ulint n_fields_cmp);
216
217/* Estimate the number of bytes that are going to be allocated when
218creating a new dtuple_t object */
219#define DTUPLE_EST_ALLOC(n_fields) \
220 (sizeof(dtuple_t) + (n_fields) * sizeof(dfield_t))
221
222/** Creates a data tuple from an already allocated chunk of memory.
223 The size of the chunk must be at least DTUPLE_EST_ALLOC(n_fields).
224 The default value for number of fields used in record comparisons
225 for this tuple is n_fields.
226 @param[in,out] buf buffer to use
227 @param[in] buf_size buffer size
228 @param[in] n_fields number of field
229 @param[in] n_v_fields number of fields on virtual columns
230 @return created tuple (inside buf) */
231[[nodiscard]] static inline dtuple_t *dtuple_create_from_mem(void *buf,
234 ulint n_v_fields);
235/** Creates a data tuple to a memory heap. The default value for number
236 of fields used in record comparisons for this tuple is n_fields.
237 @return own: created tuple */
238static inline dtuple_t *dtuple_create(
239 mem_heap_t *heap, /*!< in: memory heap where the tuple
240 is created, DTUPLE_EST_ALLOC(n_fields)
241 bytes will be allocated from this heap */
242 ulint n_fields) /*!< in: number of fields */
243 MY_ATTRIBUTE((malloc));
244
245/** Initialize the virtual field data in a dtuple_t
246@param[in,out] vrow dtuple contains the virtual fields */
247static inline void dtuple_init_v_fld(const dtuple_t *vrow);
248
249/** Duplicate the virtual field data in a dtuple_t
250@param[in,out] vrow dtuple contains the virtual fields
251@param[in] heap heap memory to use */
252static inline void dtuple_dup_v_fld(const dtuple_t *vrow, mem_heap_t *heap);
253
254/** Creates a data tuple with possible virtual columns to a memory heap.
255@param[in] heap memory heap where the tuple is created
256@param[in] n_fields number of fields
257@param[in] n_v_fields number of fields on virtual col
258@return own: created tuple */
261 ulint n_v_fields);
262/** Sets number of fields used in a tuple. Normally this is set in
263dtuple_create, but if you want later to set it smaller, you can use this.
264@param[in] tuple Tuple.
265@param[in] n_fields Number of fields. */
267
268/** Copies a data tuple's virtual fields to another. This is a shallow copy;
269@param[in,out] d_tuple destination tuple
270@param[in] s_tuple source tuple */
271static inline void dtuple_copy_v_fields(dtuple_t *d_tuple,
272 const dtuple_t *s_tuple);
273/** Copies a data tuple to another. This is a shallow copy; if a deep copy
274 is desired, dfield_dup() will have to be invoked on each field.
275 @return own: copy of tuple */
276static inline dtuple_t *dtuple_copy(
277 const dtuple_t *tuple, /*!< in: tuple to copy from */
278 mem_heap_t *heap) /*!< in: memory heap
279 where the tuple is created */
280 MY_ATTRIBUTE((malloc));
281
282/** The following function returns the sum of data lengths of a tuple. The space
283occupied by the field structs or the tuple struct is not counted.
284@param[in] tuple typed data tuple
285@param[in] comp nonzero=ROW_FORMAT=COMPACT
286@return sum of data lens */
287static inline ulint dtuple_get_data_size(const dtuple_t *tuple, ulint comp);
288/** Compare two data tuples.
289@param[in] tuple1 first data tuple
290@param[in] tuple2 second data tuple
291@return whether tuple1==tuple2 */
292[[nodiscard]] bool dtuple_coll_eq(const dtuple_t *tuple1,
293 const dtuple_t *tuple2);
294
295/** Compute a hash value of a prefix of an index record.
296@param[in] tuple index record
297@param[in] n_fields number of fields to include
298@param[in] n_bytes number of bytes to hash in the last field
299@param[in] hash_value hash value of the index identifier
300@return the hashed value */
301[[nodiscard]] static inline uint64_t dtuple_hash(const dtuple_t *tuple,
302 ulint n_fields, ulint n_bytes,
303 uint64_t hash_value);
304
305/** Sets types of fields binary in a tuple.
306@param[in] tuple data tuple
307@param[in] n number of fields to set */
308static inline void dtuple_set_types_binary(dtuple_t *tuple, ulint n);
309
310/** Checks if a dtuple contains an SQL null value.
311 @return true if some field is SQL null */
312[[nodiscard]] static inline bool dtuple_contains_null(
313 const dtuple_t *tuple); /*!< in: dtuple */
314/** Checks that a data field is typed. Asserts an error if not.
315 @return true if ok */
316[[nodiscard]] bool dfield_check_typed(
317 const dfield_t *field); /*!< in: data field */
318/** Checks that a data tuple is typed. Asserts an error if not.
319 @return true if ok */
320[[nodiscard]] bool dtuple_check_typed(const dtuple_t *tuple); /*!< in: tuple */
321#ifdef UNIV_DEBUG
322/** Validates the consistency of a tuple which must be complete, i.e,
323 all fields must have been set.
324 @return true if ok */
325[[nodiscard]] bool dtuple_validate(const dtuple_t *tuple); /*!< in: tuple */
326#endif /* UNIV_DEBUG */
327/** Pretty prints a dfield value according to its data type. Also the hex string
328 is printed if a string contains non-printable characters. */
329void dfield_print_also_hex(const dfield_t *dfield); /*!< in: dfield */
330
331/** The following function prints the contents of a tuple.
332@param[in,out] f Output stream.
333@param[in] tuple Tuple to print. */
334void dtuple_print(FILE *f, const dtuple_t *tuple);
335
336/** Print the contents of a tuple.
337@param[out] o output stream
338@param[in] field array of data fields
339@param[in] n number of data fields */
340void dfield_print(std::ostream &o, const dfield_t *field, ulint n);
341
342/** Print the contents of a tuple.
343@param[out] o output stream
344@param[in] tuple data tuple */
345void dtuple_print(std::ostream &o, const dtuple_t *tuple);
346
347/** Print the contents of a tuple.
348@param[out] o output stream
349@param[in] tuple data tuple */
350inline std::ostream &operator<<(std::ostream &o, const dtuple_t &tuple) {
351 dtuple_print(o, &tuple);
352 return (o);
353}
354
355/** Moves parts of long fields in entry to the big record vector so that
356the size of tuple drops below the maximum record size allowed in the
357database. Moves data only from those fields which are not necessary
358to determine uniquely the insertion place of the tuple in the index.
359@param[in,out] index Index that owns the record.
360@param[in,out] upd Update vector.
361@param[in,out] entry Index entry.
362@return own: created big record vector, NULL if we are not able to
363shorten the entry enough, i.e., if there are too many fixed-length or
364short fields in entry or the index is clustered */
365[[nodiscard]] big_rec_t *dtuple_convert_big_rec(dict_index_t *index, upd_t *upd,
367 MY_ATTRIBUTE((malloc));
368
369/** Puts back to entry the data stored in vector. Note that to ensure the
370fields in entry can accommodate the data, vector must have been created
371from entry with dtuple_convert_big_rec.
372@param[in] entry Entry whose data was put to vector.
373@param[in] vector Big rec vector; it is freed in this function*/
375
376/** Frees the memory in a big rec vector. */
377static inline void dtuple_big_rec_free(
378 big_rec_t *vector); /*!< in, own: big rec vector; it is
379 freed in this function */
380
381/*######################################################################*/
382
383/** Structure to hold number of multiple values */
385 public:
386 /** points to different value */
387 const void **datap;
388
389 /** each individual value length */
390 uint32_t *data_len;
391
392 /** convert buffer if the data is an integer */
393 uint64_t *conv_buf;
394
395 /** number of values */
396 uint32_t num_v;
397
398 /** number of pointers allocated */
399 uint32_t num_alc;
400
401 /** Bitset to indicate which data should be handled for current data
402 array. This is mainly used for UPDATE case. UPDATE may not need
403 to delete all old values and insert all new values because there could
404 be some same values in both old and new data array.
405 If current data array is for INSERT and DELETE, this can(should) be
406 nullptr since all values in current array should be handled in these
407 two cases. */
409
410 /** Allocate specified number of elements for all arrays and initialize
411 the structure accordingly
412 @param[in] num number of elements to allocate
413 @param[in] bitset true if memory for bitset should be
414 allocated too
415 @param[in,out] heap memory heap */
416 void alloc(uint32_t num, bool bitset, mem_heap_t *heap);
417
418 /** Allocate the bitset for current data array
419 @param[in,out] heap memory heap
420 @param[in] size size of the bitset, if 0 or default,
421 the size would be num_v */
422 void alloc_bitset(mem_heap_t *heap, uint32_t size = 0);
423
424 /** Check if two multi_value_data are equal or not, regardless of bitset
425 @param[in] multi_value Another multi-value data to be compared
426 @return true if two data structures are equal, otherwise false */
427 bool equal(const multi_value_data *multi_value) const {
428 if (num_v != multi_value->num_v) {
429 return (false);
430 }
431
432 for (uint32_t i = 0; i < num_v; ++i) {
433 if (data_len[i] != multi_value->data_len[i] ||
434 memcmp(datap[i], multi_value->datap[i], data_len[i]) != 0) {
435 return (false);
436 }
437 }
438
439 return (true);
440 }
441
442 /** Copy a multi_value_data structure
443 @param[in] multi_value multi_value structure to copy from
444 @param[in,out] heap memory heap */
445 void copy(const multi_value_data *multi_value, mem_heap_t *heap) {
446 if (num_alc < multi_value->num_v) {
447 alloc(multi_value->num_v, (multi_value->bitset != nullptr), heap);
448 }
449
450 copy_low(multi_value, heap);
451 }
452
453 /** Compare and check if one value from dfield_t is in current data set.
454 Any caller calls this function to check if one field from clustered index
455 is equal to a record on multi-value index should understand that this
456 function can only be used for equality comparison, rather than order
457 comparison
458 @param[in] type type of the data
459 @param[in] data data value to compare
460 @param[in] len length of data
461 @return true if the value exists in current data set, otherwise false */
462 bool has(const dtype_t *type, const byte *data, uint64_t len) const;
463
464 /** Compare and check if one value from dfield_t is in current data set.
465 Any caller calls this function to check if one field from clustered index
466 is equal to a record on multi-value index should understand that this
467 function can only be used for equality comparison, rather than order
468 comparison
469 @param[in] mtype mtype of data
470 @param[in] prtype prtype of data
471 @param[in] data data value to compare
472 @param[in] len length of data
473 @return true if the value exists in current data set, otherwise false */
474 bool has(ulint mtype, ulint prtype, const byte *data, uint64_t len) const;
475
476#ifdef UNIV_DEBUG
477 /* Check if there is any duplicate data in this array.
478 It is safe to assume all the data has been sorted.
479 @return true if duplicate data found, otherwise false */
480 bool duplicate() const {
481 /* Since the array is guaranteed to be sorted, so it is fine to
482 scan it sequentially and only compare current one with previous one
483 if exists. */
484 if (num_v > 1) {
485 for (uint32_t i = 1; i < num_v; ++i) {
486 if (data_len[i] == data_len[i - 1] &&
487 memcmp(datap[i], datap[i - 1], data_len[i]) == 0) {
488 return (true);
489 }
490 }
491 }
492 return (false);
493 }
494#endif /* UNIV_DEBUG */
495
496 private:
497 /** Copy a multi_value_data structure, current one should be bigger
498 or equal to the one to be copied
499 @param[in] multi_value multi_value structure to copy from
500 @param[in,out] heap memory heap */
501 void copy_low(const multi_value_data *multi_value, mem_heap_t *heap) {
502 ut_ad(num_alc >= multi_value->num_v);
503 for (uint32_t i = 0; i < multi_value->num_v; ++i) {
504 datap[i] =
505 mem_heap_dup(heap, multi_value->datap[i], multi_value->data_len[i]);
506 }
507 memcpy(data_len, multi_value->data_len,
508 sizeof(*data_len) * multi_value->num_v);
509 memcpy(conv_buf, multi_value->conv_buf,
510 sizeof(*conv_buf) * multi_value->num_v);
511 if (multi_value->bitset != nullptr) {
512 ut_ad(bitset != nullptr);
513 *bitset = *multi_value->bitset;
514 }
515 num_v = multi_value->num_v;
516 }
517
518 public:
519 /** default number of multiple values */
520 static constexpr uint32_t s_default_allocate_num = 24;
521};
522
523/** Class to log the multi-value data and read it from the log */
525 public:
526 /** Constructor
527 @param[in] mv_data multi-value data structure to log
528 @param[in] field_len multi-value data field length */
529 Multi_value_logger(const multi_value_data *mv_data, uint32_t field_len)
530 : m_mv_data(mv_data), m_field_len(field_len) {}
531
532 /** Get the log length for the multi-value data
533 @param[in] precise true if precise length is needed, false if rough
534 estimation is OK
535 @return the total log length for the multi-value data */
536 uint32_t get_log_len(bool precise) const;
537
538 /** Log the multi-value data to specified memory
539 @param[in,out] ptr the memory to write
540 @return next to the end of the multi-value data log */
541 byte *log(byte **ptr);
542
543 /** Read the log length for the multi-value data log starting from ptr
544 @param[in] ptr log starting from here
545 @return the length of this log */
546 static uint32_t read_log_len(const byte *ptr);
547
548 /** Read the multi-value data from the ptr
549 @param[in] ptr log starting from here
550 @param[in,out] field multi-value data field to store the array
551 @param[in,out] heap memory heap
552 @return next to the end of the multi-value data log */
553 static const byte *read(const byte *ptr, dfield_t *field, mem_heap_t *heap);
554
555 /** Estimate how many multi-value keys at most can be accommodated into the
556 log of specified size.
557 @param[in] log_size max log size
558 @param[in] key_length max multi-value key length, charset considered
559 @param[out] num_keys max possible number of multi-value keys
560 @return the total size of the keys, let's assume all keys are concatenated
561 one by one compactly */
562 static uint32_t get_keys_capacity(uint32_t log_size, uint32_t key_length,
563 uint32_t *num_keys);
564
565 /** Determine if the log starting from ptr is for multi-value data
566 @return true if it is for multi-value data, otherwise false */
567 static bool is_multi_value_log(const byte *ptr) {
569 }
570
571 private:
572 /** Multi-value data */
574
575 /** Multi-value field length */
576 uint32_t m_field_len;
577
578 /** Length of log for NULL value or no indexed value cases */
579 static constexpr uint32_t s_log_length_for_null_or_empty = 2;
580
581 /** Multi-value virtual column length marker. With this length marker,
582 a multi-value virtual column undo log can be identified. Meanwhile, this
583 marker should/will not conflict with any normal compressed written length
584 leading byte */
585 static constexpr uint8_t s_multi_value_virtual_col_length_marker = 0xFF;
586
587 /** Multi-value virtual column length, which indicates that there is
588 no value on the multi-value index. It's mapped to UNIV_NO_INDEX_VALUE */
589 static constexpr uint16_t s_multi_value_no_index_value = 0x0;
590
591 /** Multi-value virtual column length, which indicates that the field
592 is NULL. It's mapped to UNIV_SQL_NULL. Since any not NULL and not no value
593 multi-value data must be longer than 1 byte, so this is safe for this
594 special meaning */
595 static constexpr uint16_t s_multi_value_null = 0x1;
596
597 /** The compressed length for multi-value key length logging.
598 This would not be longer than 2 bytes for now, while 2 bytes can
599 actually support key length of 16384 bytes. And the actual key
600 length would never be longer than this */
601 static constexpr uint8_t s_max_compressed_mv_key_length_size = 2;
602};
603
604/** Structure for an SQL data field */
605struct dfield_t {
606 void *data; /*!< pointer to data */
607 bool ext; /*!< true=externally stored, false=local */
608 unsigned spatial_status : 2;
609 /*!< spatial status of externally stored field
610 in undo log for purge */
611 unsigned len; /*!< data length; UNIV_SQL_NULL if SQL null */
612 dtype_t type; /*!< type of data */
613
614 bool is_virtual() const { return (type.is_virtual()); }
615
616 void reset() {
617 data = nullptr;
618 ext = false;
620 }
621
622 /** Create a deep copy of this object
623 @param[in] heap the memory heap in which the clone will be
624 created.
625 @return the cloned object. */
626 dfield_t *clone(mem_heap_t *heap);
627
628 byte *blobref() const;
629
630 /** Obtain the LOB version number, if this is an externally
631 stored field. */
632 uint32_t lob_version() const;
633
635 : data(nullptr), ext(0), spatial_status(0), len(0), type({0, 0, 0, 0}) {}
636
637 /** Print the dfield_t object into the given output stream.
638 @param[in] out the output stream.
639 @return the output stream. */
640 std::ostream &print(std::ostream &out) const;
641
642 /** Adjust and(or) set virtual column value which is read from undo
643 or online DDL log
644 @param[in] vcol virtual column definition
645 @param[in] comp true if compact format
646 @param[in] field virtual column value
647 @param[in] len value length
648 @param[in,out] heap memory heap to keep value when necessary */
649 void adjust_v_data_mysql(const dict_v_col_t *vcol, bool comp,
650 const byte *field, ulint len, mem_heap_t *heap);
651};
652
653/** Compare a multi-value clustered index field with a secondary index
654field, to see if they are equal. If the clustered index field is the
655array, then equal means it contains the secondary index field
656@param[in] clust_field clustered index field
657@param[in] clust_len clustered index field length
658@param[in] sec_field secondary index field
659@param[in] sec_len secondary index field length
660@param[in] col the column tied to this field
661@return true if they are equal, otherwise false */
662bool is_multi_value_clust_and_sec_equal(const byte *clust_field,
663 uint64_t clust_len,
664 const byte *sec_field, uint64_t sec_len,
665 const dict_col_t *col);
666
667/** Overloading the global output operator to easily print the given dfield_t
668object into the given output stream.
669@param[in] out the output stream
670@param[in] obj the given object to print.
671@return the output stream. */
672inline std::ostream &operator<<(std::ostream &out, const dfield_t &obj) {
673 return (obj.print(out));
674}
675
676#ifdef UNIV_DEBUG
677/** Value of dtuple_t::magic_n */
678constexpr uint32_t DATA_TUPLE_MAGIC_N = 65478679;
679#endif
680
681/** Structure for an SQL data tuple of fields (logical record) */
682struct dtuple_t {
683 /** info bits of an index record: the default is 0; this field is used if an
684 index record is built from a data tuple */
685 uint16_t info_bits;
686
687 /** Number of fields in dtuple */
688 uint16_t n_fields;
689
690 /** number of fields which should be used in comparison services of rem0cmp.*;
691 the index search is performed by comparing only these fields, others are
692 ignored; the default value in dtuple creation is the same value as n_fields */
693 uint16_t n_fields_cmp;
694
695 /** Fields. */
697
698 /** Number of virtual fields. */
699 uint16_t n_v_fields;
700
701 /** Fields on virtual column */
703
704 /** Data tuples can be linked into a list using this field */
706
707#ifdef UNIV_DEBUG
708 /** Memory heap where this tuple is allocated. */
710
711 /** Value of dtuple_t::magic_n */
712 static constexpr size_t MAGIC_N = 614679;
713
714 /** Magic number, used in debug assertions */
716#endif /* UNIV_DEBUG */
717
718 /** Print the tuple to the output stream.
719 @param[in,out] out Stream to output to.
720 @return stream */
721 std::ostream &print(std::ostream &out) const {
722 dtuple_print(out, this);
723 return out;
724 }
725
726 /** Read the trx id from the tuple (DB_TRX_ID)
727 @return transaction id of the tuple. */
728 trx_id_t get_trx_id() const;
729
730 /** Ignore at most n trailing default fields if this is a tuple
731 from instant index
732 @param[in] index clustered index object for this tuple */
733 void ignore_trailing_default(const dict_index_t *index);
734
735 /** Compare a data tuple to a physical record.
736 @param[in] rec record
737 @param[in] index index
738 @param[in] offsets rec_get_offsets(rec)
739 @param[in,out] matched_fields number of completely matched fields
740 @return the comparison result of dtuple and rec
741 @retval 0 if dtuple is equal to rec
742 @retval negative if dtuple is less than rec
743 @retval positive if dtuple is greater than rec */
744 int compare(const rec_t *rec, const dict_index_t *index, const ulint *offsets,
745 ulint *matched_fields) const;
746
747 /** Compare a data tuple to a physical record.
748 @param[in] rec record
749 @param[in] index index
750 @param[in] offsets rec_get_offsets(rec)
751 @return the comparison result of dtuple and rec
752 @retval 0 if dtuple is equal to rec
753 @retval negative if dtuple is less than rec
754 @retval positive if dtuple is greater than rec */
755 inline int compare(const rec_t *rec, const dict_index_t *index,
756 const ulint *offsets) const {
757 ulint matched_fields{};
758
759 return (compare(rec, index, offsets, &matched_fields));
760 }
761
762 /** Get number of externally stored fields.
763 @retval number of externally stored fields. */
764 inline size_t get_n_ext() const {
765 size_t n_ext = 0;
766 for (uint32_t i = 0; i < n_fields; ++i) {
767 if (dfield_is_ext(&fields[i])) {
768 ++n_ext;
769 }
770 }
771 return n_ext;
772 }
773
774 /** Set the flag REC_INFO_MIN_REC_FLAG in the info bits. */
775 void set_min_rec_flag();
776
777 /** Unset the flag REC_INFO_MIN_REC_FLAG in the info bits. */
778 void unset_min_rec_flag();
779
780 /** Does tuple has externally stored fields.
781 @retval true if there is externally stored fields. */
782 inline bool has_ext() const {
783 for (uint32_t i = 0; i < n_fields; ++i) {
784 if (dfield_is_ext(&fields[i])) {
785 return true;
786 }
787 }
788 return false;
789 }
790
791 dtuple_t *deep_copy(mem_heap_t *heap) const;
792};
793
794/** A slot for a field in a big rec vector */
796 /** Constructor.
797 @param[in] field_no_ the field number
798 @param[in] len_ the data length
799 @param[in] data_ the data */
800 big_rec_field_t(ulint field_no_, ulint len_, void *data_)
801 : field_no(field_no_),
802 len(len_),
803 data(data_),
804 ext_in_old(false),
805 ext_in_new(false) {}
806
807 byte *ptr() const { return (static_cast<byte *>(data)); }
808
809 ulint field_no; /*!< field number in record */
810 ulint len; /*!< stored data length, in bytes */
811 void *data; /*!< stored data */
812
813 /** If true, this field was stored externally in the old row.
814 If false, this field was stored inline in the old row.*/
816
817 /** If true, this field is stored externally in the new row.
818 If false, this field is stored inline in the new row.*/
820
821 /** Print the big_rec_field_t object into the given output stream.
822 @param[in] out the output stream.
823 @return the output stream. */
824 std::ostream &print(std::ostream &out) const;
825};
826
827/** Overloading the global output operator to easily print the given
828big_rec_field_t object into the given output stream.
829@param[in] out the output stream
830@param[in] obj the given object to print.
831@return the output stream. */
832inline std::ostream &operator<<(std::ostream &out, const big_rec_field_t &obj) {
833 return (obj.print(out));
834}
835
836/** Storage format for overflow data in a big record, that is, a
837clustered index record which needs external storage of data fields */
838struct big_rec_t {
839 mem_heap_t *heap; /*!< memory heap from which
840 allocated */
841 const ulint capacity; /*!< fields array size */
842 ulint n_fields; /*!< number of stored fields */
843 big_rec_field_t *fields; /*!< stored fields */
844
845 /** Constructor.
846 @param[in] max the capacity of the array of fields. */
847 explicit big_rec_t(const ulint max)
848 : heap(nullptr), capacity(max), n_fields(0), fields(nullptr) {}
849
850 /** Append one big_rec_field_t object to the end of array of fields */
851 void append(const big_rec_field_t &field) {
853 fields[n_fields] = field;
854 n_fields++;
855 }
856
857 /** Allocate a big_rec_t object in the given memory heap, and for
858 storing n_fld number of fields.
859 @param[in] heap memory heap in which this object is allocated
860 @param[in] n_fld maximum number of fields that can be stored in
861 this object
862 @return the allocated object */
863 static big_rec_t *alloc(mem_heap_t *heap, ulint n_fld);
864
865 /** Print the current object into the given output stream.
866 @param[in] out the output stream.
867 @return the output stream. */
868 std::ostream &print(std::ostream &out) const;
869};
870
871/** Overloading the global output operator to easily print the given
872big_rec_t object into the given output stream.
873@param[in] out the output stream
874@param[in] obj the given object to print.
875@return the output stream. */
876inline std::ostream &operator<<(std::ostream &out, const big_rec_t &obj) {
877 return (obj.print(out));
878}
879
880#include "data0data.ic"
881
882#endif
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
A simple bitset wrapper class, whose size can be specified after the object has been defined.
Definition: ut0bitset.h:39
Class to log the multi-value data and read it from the log.
Definition: data0data.h:524
Multi_value_logger(const multi_value_data *mv_data, uint32_t field_len)
Constructor.
Definition: data0data.h:529
static uint32_t read_log_len(const byte *ptr)
Read the log length for the multi-value data log starting from ptr.
Definition: data0data.cc:972
static constexpr uint16_t s_multi_value_no_index_value
Multi-value virtual column length, which indicates that there is no value on the multi-value index.
Definition: data0data.h:589
static constexpr uint32_t s_log_length_for_null_or_empty
Length of log for NULL value or no indexed value cases.
Definition: data0data.h:579
static bool is_multi_value_log(const byte *ptr)
Determine if the log starting from ptr is for multi-value data.
Definition: data0data.h:567
const multi_value_data * m_mv_data
Multi-value data.
Definition: data0data.h:573
static constexpr uint16_t s_multi_value_null
Multi-value virtual column length, which indicates that the field is NULL.
Definition: data0data.h:595
uint32_t m_field_len
Multi-value field length.
Definition: data0data.h:576
static uint32_t get_keys_capacity(uint32_t log_size, uint32_t key_length, uint32_t *num_keys)
Estimate how many multi-value keys at most can be accommodated into the log of specified size.
Definition: data0data.cc:1031
byte * log(byte **ptr)
Log the multi-value data to specified memory.
Definition: data0data.cc:932
uint32_t get_log_len(bool precise) const
Get the log length for the multi-value data.
Definition: data0data.cc:896
static constexpr uint8_t s_multi_value_virtual_col_length_marker
Multi-value virtual column length marker.
Definition: data0data.h:585
static const byte * read(const byte *ptr, dfield_t *field, mem_heap_t *heap)
Read the multi-value data from the ptr.
Definition: data0data.cc:985
static constexpr uint8_t s_max_compressed_mv_key_length_size
The compressed length for multi-value key length logging.
Definition: data0data.h:601
constexpr DWORD buf_size
Definition: create_def.cc:229
static void dtuple_init_v_fld(const dtuple_t *vrow)
Initialize the virtual field data in a dtuple_t.
bool dfield_datas_are_binary_equal(const dfield_t *field1, const dfield_t *field2, ulint len)
Tests if two data fields are equal.
Definition: data0data.ic:249
static spatial_status_t dfield_get_spatial_status(const dfield_t *field)
Gets spatial status for "external storage".
static uint64_t dtuple_hash(const dtuple_t *tuple, ulint n_fields, ulint n_bytes, uint64_t hash_value)
Compute a hash value of a prefix of an index record.
static void dfield_set_data(dfield_t *field, const void *data, ulint len)
Sets pointer to the data and length in a field.
static void dfield_set_ext(dfield_t *field)
Sets the "external storage" flag.
static void dtuple_set_info_bits(dtuple_t *tuple, ulint info_bits)
Sets info bits in a data tuple.
static void dfield_copy(dfield_t *field1, const dfield_t *field2)
Copies a data field to another.
static ulint dtuple_get_n_fields_cmp(const dtuple_t *tuple)
Gets number of fields used in record comparisons.
void dtuple_print(FILE *f, const dtuple_t *tuple)
The following function prints the contents of a tuple.
Definition: data0data.cc:368
static dtuple_t * dtuple_create(mem_heap_t *heap, ulint n_fields)
Creates a data tuple to a memory heap.
big_rec_t * dtuple_convert_big_rec(dict_index_t *index, upd_t *upd, dtuple_t *entry)
Moves parts of long fields in entry to the big record vector so that the size of tuple drops below th...
Definition: data0data.cc:422
static ulint dtuple_get_data_size(const dtuple_t *tuple, ulint comp)
The following function returns the sum of data lengths of a tuple.
static void dtuple_set_n_fields_cmp(dtuple_t *tuple, ulint n_fields_cmp)
Gets number of fields used in record comparisons.
static void dtuple_dup_v_fld(const dtuple_t *vrow, mem_heap_t *heap)
Duplicate the virtual field data in a dtuple_t.
static void dfield_set_len(dfield_t *field, ulint len)
Sets length in a field.
static void dfield_dup(dfield_t *field, mem_heap_t *heap)
Copies the data pointed to by a data field.
static void dfield_set_type(dfield_t *field, const dtype_t *type)
Sets the type struct of SQL data field.
static void dfield_multi_value_dup(dfield_t *field, mem_heap_t *heap)
Copies the data pointed to by a data field.
static void data_write_sql_null(byte *data, ulint len)
Writes an SQL null field full of zeros.
static void dfield_write_mbr(dfield_t *field, const double *mbr)
Sets pointer to the data and length in a field.
bool dfield_check_typed(const dfield_t *field)
Checks that a data field is typed.
Definition: data0data.cc:147
static dfield_t * dtuple_get_nth_v_field(const dtuple_t *tuple, ulint n)
Gets nth virtual field of a tuple.
bool dtuple_coll_eq(const dtuple_t *tuple1, const dtuple_t *tuple2)
Compare two data tuples.
Definition: data0data.cc:61
static uint32_t dfield_get_len(const dfield_t *field)
Gets length of field data.
void dfield_print_also_hex(const dfield_t *dfield)
Pretty prints a dfield value according to its data type.
Definition: data0data.cc:204
static bool dfield_is_ext(const dfield_t *field)
Determines if a field is externally stored.
static dtuple_t * dtuple_create_with_vcol(mem_heap_t *heap, ulint n_fields, ulint n_v_fields)
Creates a data tuple with possible virtual columns to a memory heap.
static dtuple_t * dtuple_create_from_mem(void *buf, ulint buf_size, ulint n_fields, ulint n_v_fields)
Creates a data tuple from an already allocated chunk of memory.
static void dtuple_big_rec_free(big_rec_t *vector)
Frees the memory in a big rec vector.
Definition: data0data.ic:651
static dtype_t * dfield_get_type(const dfield_t *field)
Gets pointer to the type struct of SQL data field.
static void dfield_set_spatial_status(dfield_t *field, spatial_status_t spatial_status)
Sets spatial status for "external storage".
static void dtuple_set_types_binary(dtuple_t *tuple, ulint n)
Sets types of fields binary in a tuple.
bool is_multi_value_clust_and_sec_equal(const byte *clust_field, uint64_t clust_len, const byte *sec_field, uint64_t sec_len, const dict_col_t *col)
Compare a multi-value clustered index field with a secondary index field, to see if they are equal.
Definition: data0data.cc:827
static dfield_t * dtuple_get_nth_field(const dtuple_t *tuple, ulint n)
Gets nth field of a tuple.
static bool dtuple_contains_null(const dtuple_t *tuple)
Checks if a dtuple contains an SQL null value.
constexpr uint32_t DATA_TUPLE_MAGIC_N
Value of dtuple_t::magic_n.
Definition: data0data.h:678
std::ostream & operator<<(std::ostream &o, const dtuple_t &tuple)
Print the contents of a tuple.
Definition: data0data.h:350
bool dtuple_check_typed(const dtuple_t *tuple)
Checks that a data tuple is typed.
Definition: data0data.cc:158
void dtuple_convert_back_big_rec(dtuple_t *entry, big_rec_t *vector)
Puts back to entry the data stored in vector.
Definition: data0data.cc:621
static bool dfield_is_multi_value(const dfield_t *field)
Determine if a field is of multi-value type.
static void dfield_copy_data(dfield_t *field1, const dfield_t *field2)
Copies the data and len fields.
static ulint dtuple_get_n_fields(const dtuple_t *tuple)
Gets number of fields in a data tuple.
static void dtuple_copy_v_fields(dtuple_t *d_tuple, const dtuple_t *s_tuple)
Copies a data tuple's virtual fields to another.
static dtuple_t * dtuple_copy(const dtuple_t *tuple, mem_heap_t *heap)
Copies a data tuple to another.
bool dtuple_validate(const dtuple_t *tuple)
Validates the consistency of a tuple which must be complete, i.e, all fields must have been set.
Definition: data0data.cc:171
void dfield_print(std::ostream &o, const dfield_t *field, ulint n)
Print the contents of a tuple.
Definition: data0data.cc:385
static ulint dtuple_get_n_v_fields(const dtuple_t *tuple)
Gets number of virtual fields in a data tuple.
void dtuple_set_n_fields(dtuple_t *tuple, ulint n_fields)
Sets number of fields used in a tuple.
Definition: data0data.cc:96
static void * dfield_get_data(const dfield_t *field)
Gets pointer to the data in a field.
static ulint dtuple_get_info_bits(const dtuple_t *tuple)
Gets info bits in a data tuple.
static bool dfield_data_is_binary_equal(const dfield_t *field, ulint len, const byte *data)
Tests if dfield data length and content is equal to the given.
static void dfield_set_null(dfield_t *field)
Sets a data field to SQL NULL.
static ulint dfield_is_null(const dfield_t *field)
Determines if a field is SQL NULL.
SQL data field and tuple.
Data types.
Some type definitions.
Data dictionary global types.
spatial_status_t
whether a col is used in spatial index or regular index Note: the spatial status is part of persisten...
Definition: dict0types.h:346
@ SPATIAL_UNKNOWN
Definition: dict0types.h:348
#define malloc(A)
Definition: lexyy.cc:914
The memory management.
void * mem_heap_dup(mem_heap_t *heap, const void *data, ulint len)
Duplicate a block of data, allocated from a memory heap.
Definition: memory.cc:57
Definition: buf0block_hint.cc:30
const std::string FILE("FILE")
size_t size(const char *const c)
Definition: base64.h:46
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2874
byte rec_t
Definition: rem0types.h:41
required string type
Definition: replication_group_member_actions.proto:34
Definition: completion_hash.h:35
A slot for a field in a big rec vector.
Definition: data0data.h:795
void * data
stored data
Definition: data0data.h:811
bool ext_in_new
If true, this field is stored externally in the new row.
Definition: data0data.h:819
ulint field_no
field number in record
Definition: data0data.h:809
bool ext_in_old
If true, this field was stored externally in the old row.
Definition: data0data.h:815
big_rec_field_t(ulint field_no_, ulint len_, void *data_)
Constructor.
Definition: data0data.h:800
std::ostream & print(std::ostream &out) const
Print the big_rec_field_t object into the given output stream.
Definition: data0data.cc:764
ulint len
stored data length, in bytes
Definition: data0data.h:810
byte * ptr() const
Definition: data0data.h:807
Storage format for overflow data in a big record, that is, a clustered index record which needs exter...
Definition: data0data.h:838
void append(const big_rec_field_t &field)
Append one big_rec_field_t object to the end of array of fields.
Definition: data0data.h:851
const ulint capacity
fields array size
Definition: data0data.h:841
big_rec_field_t * fields
stored fields
Definition: data0data.h:843
big_rec_t(const ulint max)
Constructor.
Definition: data0data.h:847
ulint n_fields
number of stored fields
Definition: data0data.h:842
mem_heap_t * heap
memory heap from which allocated
Definition: data0data.h:839
std::ostream & print(std::ostream &out) const
Print the current object into the given output stream.
Definition: data0data.cc:771
static big_rec_t * alloc(mem_heap_t *heap, ulint n_fld)
Allocate a big_rec_t object in the given memory heap, and for storing n_fld number of fields.
Definition: data0data.cc:648
Structure for an SQL data field.
Definition: data0data.h:605
std::ostream & print(std::ostream &out) const
Print the dfield_t object into the given output stream.
Definition: data0data.cc:748
uint32_t lob_version() const
Obtain the LOB version number, if this is an externally stored field.
Definition: data0data.cc:688
dtype_t type
type of data
Definition: data0data.h:612
unsigned spatial_status
spatial status of externally stored field in undo log for purge
Definition: data0data.h:608
void reset()
Definition: data0data.h:616
byte * blobref() const
Definition: data0data.cc:682
bool ext
true=externally stored, false=local
Definition: data0data.h:607
dfield_t()
Definition: data0data.h:634
unsigned len
data length; UNIV_SQL_NULL if SQL null
Definition: data0data.h:611
dfield_t * clone(mem_heap_t *heap)
Create a deep copy of this object.
Definition: data0data.cc:662
void adjust_v_data_mysql(const dict_v_col_t *vcol, bool comp, const byte *field, ulint len, mem_heap_t *heap)
Adjust and(or) set virtual column value which is read from undo or online DDL log.
Definition: data0data.cc:696
bool is_virtual() const
Definition: data0data.h:614
void * data
pointer to data
Definition: data0data.h:606
Data structure for a column in a table.
Definition: dict0mem.h:489
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a virtual column in a table.
Definition: dict0mem.h:815
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:682
size_t get_n_ext() const
Get number of externally stored fields.
Definition: data0data.h:764
void set_min_rec_flag()
Set the flag REC_INFO_MIN_REC_FLAG in the info bits.
Definition: data0data.cc:863
dtuple_t * deep_copy(mem_heap_t *heap) const
Definition: data0data.cc:1058
mem_heap_t * m_heap
Memory heap where this tuple is allocated.
Definition: data0data.h:709
uint16_t n_fields
Number of fields in dtuple.
Definition: data0data.h:688
int compare(const rec_t *rec, const dict_index_t *index, const ulint *offsets) const
Compare a data tuple to a physical record.
Definition: data0data.h:755
static constexpr size_t MAGIC_N
Value of dtuple_t::magic_n.
Definition: data0data.h:712
trx_id_t get_trx_id() const
Read the trx id from the tuple (DB_TRX_ID)
Definition: data0data.cc:782
uint16_t n_fields_cmp
number of fields which should be used in comparison services of rem0cmp.
Definition: data0data.h:693
bool has_ext() const
Does tuple has externally stored fields.
Definition: data0data.h:782
dfield_t * fields
Fields.
Definition: data0data.h:696
int compare(const rec_t *rec, const dict_index_t *index, const ulint *offsets, ulint *matched_fields) const
Compare a data tuple to a physical record.
Definition: rem0cmp.cc:1124
uint16_t n_v_fields
Number of virtual fields.
Definition: data0data.h:699
UT_LIST_NODE_T(dtuple_t) tuple_list
Data tuples can be linked into a list using this field.
std::ostream & print(std::ostream &out) const
Print the tuple to the output stream.
Definition: data0data.h:721
void ignore_trailing_default(const dict_index_t *index)
Ignore at most n trailing default fields if this is a tuple from instant index.
Definition: data0data.cc:796
uint16_t info_bits
info bits of an index record: the default is 0; this field is used if an index record is built from a...
Definition: data0data.h:685
dfield_t * v_fields
Fields on virtual column.
Definition: data0data.h:702
size_t magic_n
Magic number, used in debug assertions.
Definition: data0data.h:715
void unset_min_rec_flag()
Unset the flag REC_INFO_MIN_REC_FLAG in the info bits.
Definition: data0data.cc:864
Definition: data0type.h:498
bool is_virtual() const
Definition: data0type.h:524
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Structure to hold number of multiple values.
Definition: data0data.h:384
const void ** datap
points to different value
Definition: data0data.h:387
static constexpr uint32_t s_default_allocate_num
default number of multiple values
Definition: data0data.h:520
uint64_t * conv_buf
convert buffer if the data is an integer
Definition: data0data.h:393
void copy_low(const multi_value_data *multi_value, mem_heap_t *heap)
Copy a multi_value_data structure, current one should be bigger or equal to the one to be copied.
Definition: data0data.h:501
bool duplicate() const
Definition: data0data.h:480
uint32_t num_alc
number of pointers allocated
Definition: data0data.h:399
uint32_t num_v
number of values
Definition: data0data.h:396
void alloc_bitset(mem_heap_t *heap, uint32_t size=0)
Allocate the bitset for current data array.
Definition: data0data.cc:885
void alloc(uint32_t num, bool bitset, mem_heap_t *heap)
Allocate specified number of elements for all arrays and initialize the structure accordingly.
Definition: data0data.cc:868
bool has(const dtype_t *type, const byte *data, uint64_t len) const
Compare and check if one value from dfield_t is in current data set.
Definition: data0data.cc:845
void copy(const multi_value_data *multi_value, mem_heap_t *heap)
Copy a multi_value_data structure.
Definition: data0data.h:445
Bitset * bitset
Bitset to indicate which data should be handled for current data array.
Definition: data0data.h:408
uint32_t * data_len
each individual value length
Definition: data0data.h:390
bool equal(const multi_value_data *multi_value) const
Check if two multi_value_data are equal or not, regardless of bitset.
Definition: data0data.h:427
Definition: row0upd.h:565
mem_heap_t * heap
Heap from which memory allocated.
Definition: row0upd.h:569
ulint info_bits
New value of info bits to record; default is 0.
Definition: row0upd.h:577
ulint n_fields
Number of update fields.
Definition: row0upd.h:589
Transaction system global type definitions.
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406
Utilities for bitset operations.
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
int n
Definition: xcom_base.cc:509