MySQL 9.1.0
Source Code Documentation
multi_value_data Struct Reference

Structure to hold number of multiple values. More...

#include <data0data.h>

Public Member Functions

void alloc (uint32_t num, bool bitset, mem_heap_t *heap)
 Allocate specified number of elements for all arrays and initialize the structure accordingly. More...
 
void alloc_bitset (mem_heap_t *heap, uint32_t size=0)
 Allocate the bitset for current data array. More...
 
bool equal (const multi_value_data *multi_value) const
 Check if two multi_value_data are equal or not, regardless of bitset. More...
 
void copy (const multi_value_data *multi_value, mem_heap_t *heap)
 Copy a multi_value_data structure. More...
 
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. More...
 
bool has (ulint mtype, ulint prtype, const byte *data, uint64_t len) const
 Compare and check if one value from dfield_t is in current data set. More...
 
bool duplicate () const
 

Public Attributes

const void ** datap
 points to different value More...
 
uint32_t * data_len
 each individual value length More...
 
uint64_t * conv_buf
 convert buffer if the data is an integer More...
 
uint32_t num_v
 number of values More...
 
uint32_t num_alc
 number of pointers allocated More...
 
Bitsetbitset
 Bitset to indicate which data should be handled for current data array. More...
 
size_t bitmap_bytes {}
 The size of bitmap buffer in bytes. More...
 

Static Public Attributes

static constexpr uint32_t s_default_allocate_num = 24
 default number of multiple values More...
 

Private Member Functions

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. More...
 

Detailed Description

Structure to hold number of multiple values.

Member Function Documentation

◆ alloc()

void multi_value_data::alloc ( uint32_t  num,
bool  bitset,
mem_heap_t heap 
)

Allocate specified number of elements for all arrays and initialize the structure accordingly.

Parameters
[in]numnumber of elements to allocate
[in]bitsettrue if memory for bitset should be allocated too
[in,out]heapmemory heap

◆ alloc_bitset()

void multi_value_data::alloc_bitset ( mem_heap_t heap,
uint32_t  size = 0 
)

Allocate the bitset for current data array.

Parameters
[in,out]heapmemory heap
[in]sizesize of the bitset, if 0 or default, the size would be num_v

◆ copy()

void multi_value_data::copy ( const multi_value_data multi_value,
mem_heap_t heap 
)
inline

Copy a multi_value_data structure.

Parameters
[in]multi_valuemulti_value structure to copy from
[in,out]heapmemory heap

◆ copy_low()

void multi_value_data::copy_low ( const multi_value_data multi_value,
mem_heap_t heap 
)
inlineprivate

Copy a multi_value_data structure, current one should be bigger or equal to the one to be copied.

Parameters
[in]multi_valuemulti_value structure to copy from
[in,out]heapmemory heap

◆ duplicate()

bool multi_value_data::duplicate ( ) const
inline

◆ equal()

bool multi_value_data::equal ( const multi_value_data multi_value) const
inline

Check if two multi_value_data are equal or not, regardless of bitset.

Parameters
[in]multi_valueAnother multi-value data to be compared
Returns
true if two data structures are equal, otherwise false

◆ has() [1/2]

bool multi_value_data::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.

Any caller calls this function to check if one field from clustered index is equal to a record on multi-value index should understand that this function can only be used for equality comparison, rather than order comparison

Parameters
[in]typetype of the data
[in]datadata value to compare
[in]lenlength of data
Returns
true if the value exists in current data set, otherwise false

◆ has() [2/2]

bool multi_value_data::has ( ulint  mtype,
ulint  prtype,
const byte data,
uint64_t  len 
) const

Compare and check if one value from dfield_t is in current data set.

Any caller calls this function to check if one field from clustered index is equal to a record on multi-value index should understand that this function can only be used for equality comparison, rather than order comparison

Parameters
[in]mtypemtype of data
[in]prtypeprtype of data
[in]datadata value to compare
[in]lenlength of data
Returns
true if the value exists in current data set, otherwise false

Member Data Documentation

◆ bitmap_bytes

size_t multi_value_data::bitmap_bytes {}

The size of bitmap buffer in bytes.

The bitset might point into some prefix of it, and be later made shorter or longer, but not longer than this length of underlying buffer.

◆ bitset

Bitset* multi_value_data::bitset

Bitset to indicate which data should be handled for current data array.

This is mainly used for UPDATE case. UPDATE may not need to delete all old values and insert all new values because there could be some same values in both old and new data array. If current data array is for INSERT and DELETE, this can(should) be nullptr since all values in current array should be handled in these two cases.

◆ conv_buf

uint64_t* multi_value_data::conv_buf

convert buffer if the data is an integer

◆ data_len

uint32_t* multi_value_data::data_len

each individual value length

◆ datap

const void** multi_value_data::datap

points to different value

◆ num_alc

uint32_t multi_value_data::num_alc

number of pointers allocated

◆ num_v

uint32_t multi_value_data::num_v

number of values

◆ s_default_allocate_num

constexpr uint32_t multi_value_data::s_default_allocate_num = 24
staticconstexpr

default number of multiple values


The documentation for this struct was generated from the following files: