Class to log the multi-value data and read it from the log.
More...
#include <data0data.h>
|
static uint32_t | read_log_len (const byte *ptr) |
| Read the log length for the multi-value data log starting from ptr. More...
|
|
static const byte * | read (const byte *ptr, dfield_t *field, mem_heap_t *heap) |
| Read the multi-value data from the ptr. More...
|
|
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. More...
|
|
static bool | is_multi_value_log (const byte *ptr) |
| Determine if the log starting from ptr is for multi-value data. More...
|
|
Class to log the multi-value data and read it from the log.
◆ Multi_value_logger()
Multi_value_logger::Multi_value_logger |
( |
const multi_value_data * |
mv_data, |
|
|
uint32_t |
field_len |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
[in] | mv_data | multi-value data structure to log |
[in] | field_len | multi-value data field length |
◆ get_keys_capacity()
uint32_t Multi_value_logger::get_keys_capacity |
( |
uint32_t |
log_size, |
|
|
uint32_t |
key_length, |
|
|
uint32_t * |
num_keys |
|
) |
| |
|
static |
Estimate how many multi-value keys at most can be accommodated into the log of specified size.
- Parameters
-
[in] | log_size | max log size |
[in] | key_length | max multi-value key length, charset considered |
[out] | num_keys | max possible number of multi-value keys |
- Returns
- the total size of the keys, let's assume all keys are concatenated one by one compactly
◆ get_log_len()
uint32_t Multi_value_logger::get_log_len |
( |
bool |
precise | ) |
const |
Get the log length for the multi-value data.
- Parameters
-
[in] | precise | true if precise length is needed, false if rough estimation is OK |
- Returns
- the total log length for the multi-value data
◆ is_multi_value_log()
static bool Multi_value_logger::is_multi_value_log |
( |
const byte * |
ptr | ) |
|
|
inlinestatic |
Determine if the log starting from ptr is for multi-value data.
- Returns
- true if it is for multi-value data, otherwise false
◆ log()
byte * Multi_value_logger::log |
( |
byte ** |
ptr | ) |
|
Log the multi-value data to specified memory.
- Parameters
-
[in,out] | ptr | the memory to write |
- Returns
- next to the end of the multi-value data log
◆ read()
Read the multi-value data from the ptr.
- Parameters
-
[in] | ptr | log starting from here |
[in,out] | field | multi-value data field to store the array |
[in,out] | heap | memory heap |
- Returns
- next to the end of the multi-value data log
◆ read_log_len()
uint32_t Multi_value_logger::read_log_len |
( |
const byte * |
ptr | ) |
|
|
static |
Read the log length for the multi-value data log starting from ptr.
- Parameters
-
[in] | ptr | log starting from here |
- Returns
- the length of this log
◆ m_field_len
uint32_t Multi_value_logger::m_field_len |
|
private |
Multi-value field length.
◆ m_mv_data
◆ s_log_length_for_null_or_empty
constexpr uint32_t Multi_value_logger::s_log_length_for_null_or_empty = 2 |
|
staticconstexprprivate |
Length of log for NULL value or no indexed value cases.
◆ s_max_compressed_mv_key_length_size
constexpr uint8_t Multi_value_logger::s_max_compressed_mv_key_length_size = 2 |
|
staticconstexprprivate |
The compressed length for multi-value key length logging.
This would not be longer than 2 bytes for now, while 2 bytes can actually support key length of 16384 bytes. And the actual key length would never be longer than this
◆ s_multi_value_no_index_value
constexpr uint16_t Multi_value_logger::s_multi_value_no_index_value = 0x0 |
|
staticconstexprprivate |
Multi-value virtual column length, which indicates that there is no value on the multi-value index.
It's mapped to UNIV_NO_INDEX_VALUE
◆ s_multi_value_null
constexpr uint16_t Multi_value_logger::s_multi_value_null = 0x1 |
|
staticconstexprprivate |
Multi-value virtual column length, which indicates that the field is NULL.
It's mapped to UNIV_SQL_NULL. Since any not NULL and not no value multi-value data must be longer than 1 byte, so this is safe for this special meaning
◆ s_multi_value_virtual_col_length_marker
constexpr uint8_t Multi_value_logger::s_multi_value_virtual_col_length_marker = 0xFF |
|
staticconstexprprivate |
Multi-value virtual column length marker.
With this length marker, a multi-value virtual column undo log can be identified. Meanwhile, this marker should/will not conflict with any normal compressed written length leading byte
The documentation for this class was generated from the following files: