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