MySQL 8.4.2
Source Code Documentation
|
Data structure for a column in a table. More...
#include <dict0mem.h>
Public Member Functions | |
bool | has_prefix_phy_pos () const |
uint16_t | get_prefix_phy_pos () const |
void | set_prefix_phy_pos (uint16_t prefix_pos) |
uint16_t | get_col_phy_pos () const |
void | set_col_phy_pos (uint16_t pos) |
uint32_t | get_phy_pos () const |
void | set_phy_pos (uint32_t pos) |
bool | is_instant_added () const |
uint8_t | get_version_added () const |
void | set_version_added (uint8_t version) |
bool | is_version_added_match (const dict_col_t *col) const |
bool | is_instant_dropped () const |
uint8_t | get_version_dropped () const |
void | set_version_dropped (uint8_t version) |
bool | is_version_dropped_match (const dict_col_t *col) const |
ulint | get_min_size () const |
Returns the minimum size of the column. More... | |
ulint | get_max_size () const |
Returns the maximum size of the column. More... | |
bool | is_virtual () const |
Check if a column is a virtual column. More... | |
bool | is_multi_value () const |
Check if a column is a multi-value virtual column. More... | |
bool | is_nullable () const |
Check if a column is nullable. More... | |
void | copy_type (dtype_t *type) const |
Gets the column data type. More... | |
ulint | get_mbminlen () const |
Gets the minimum number of bytes per character. More... | |
ulint | get_mbmaxlen () const |
Gets the maximum number of bytes per character. More... | |
void | set_mbminmaxlen (ulint mbminlen, ulint mbmaxlen) |
Sets the minimum and maximum number of bytes per character. More... | |
ulint | get_fixed_size (ulint comp) const |
Returns the size of a fixed size column, 0 if not a fixed size column. More... | |
ulint | get_null_size (ulint comp) const |
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column. More... | |
spatial_status_t | get_spatial_status () const |
Check whether the col is used in spatial index or regular index. More... | |
void | set_default (const byte *value, size_t length, mem_heap_t *heap) |
Set default value. More... | |
bool | is_dropped_in_or_before (uint8_t version) const |
Check if column is dropped before the given version. More... | |
bool | is_added_after (uint8_t version) const |
Check if column is added after the current version. More... | |
bool | is_visible_in_version (uint8_t version) const |
Check if a column is visible in given version. More... | |
bool | assert_equal (const dtype_t *type) const |
Assert that a column and a data type match. More... | |
Static Public Member Functions | |
static bool | is_instant_dropped_name (const std::string col_name) |
Check if a column name resembles format for dropped column. More... | |
Public Attributes | |
unsigned | ind: 10 |
table column position (starting from 0) More... | |
unsigned | ord_part: 1 |
nonzero if this column appears in the ordering fields of an index More... | |
unsigned | max_prefix: 12 |
maximum index prefix length on this column. More... | |
bool | is_visible |
dict_col_default_t * | instant_default {nullptr} |
The following are copied from dtype_t, so that all bit-fields can be packed tightly. More... | |
unsigned | prtype: 32 |
precise type; MySQL data type, charset code, flags to indicate nullability, signedness, whether this is a binary string, whether this is a true VARCHAR where MySQL uses 2 bytes to store the length More... | |
unsigned | mtype: 8 |
main data type More... | |
unsigned | len: 16 |
length; for MySQL data this is field->pack_length(), except that for a >= 5.0.3 type true VARCHAR this is the maximum byte length of the string data (in addition to the string, MySQL uses 1 or 2 bytes to store the string length) More... | |
unsigned | mbminmaxlen: 5 |
minimum and maximum length of a character, in bytes; DATA_MBMINMAXLEN(mbminlen,mbmaxlen); mbminlen=DATA_MBMINLEN(mbminmaxlen); mbmaxlen=DATA_MBMINLEN(mbminmaxlen) More... | |
Private Attributes | |
uint32_t | phy_pos {UINT32_UNDEFINED} |
uint8_t | version_added {UINT8_UNDEFINED} |
uint8_t | version_dropped {UINT8_UNDEFINED} |
Data structure for a column in a table.
|
inline |
Assert that a column and a data type match.
param[in] type data type
|
inline |
Gets the column data type.
[out] | type | data type |
|
inline |
Returns the size of a fixed size column, 0 if not a fixed size column.
[in] | comp | nonzero=ROW_FORMAT=COMPACT |
|
inline |
Returns the maximum size of the column.
|
inline |
Gets the maximum number of bytes per character.
|
inline |
Gets the minimum number of bytes per character.
|
inline |
Returns the minimum size of the column.
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
For fixed length types it is the fixed length of the type, otherwise 0.
[in] | comp | nonzero=ROW_FORMAT=COMPACT |
|
inline |
|
inline |
|
inline |
Check whether the col is used in spatial index or regular index.
|
inline |
|
inline |
|
inline |
|
inline |
Check if column is added after the current version.
[in] | version | row version |
|
inline |
Check if column is dropped before the given version.
[in] | version | row version |
|
inline |
|
inline |
|
inlinestatic |
Check if a column name resembles format for dropped column.
param[in] type column name
|
inline |
Check if a column is a multi-value virtual column.
|
inline |
Check if a column is nullable.
|
inline |
|
inline |
|
inline |
Check if a column is a virtual column.
|
inline |
Check if a column is visible in given version.
[in] | version | row version return true if column is visible in version. |
|
inline |
void dict_col_t::set_default | ( | const byte * | value, |
size_t | length, | ||
mem_heap_t * | heap | ||
) |
Set default value.
[in] | value | Default value |
[in] | length | Default value length |
[in,out] | heap | Heap to allocate memory |
Sets the minimum and maximum number of bytes per character.
[in] | mbminlen | minimum multi byte character size, in bytes |
[in] | mbmaxlen | mAXimum multi-byte character size, in bytes |
|
inline |
|
inline |
|
inline |
|
inline |
unsigned dict_col_t::ind |
table column position (starting from 0)
dict_col_default_t* dict_col_t::instant_default {nullptr} |
The following are copied from dtype_t, so that all bit-fields can be packed tightly.
Default value when this column was added instantly. If this is not a instantly added column then this is nullptr.
bool dict_col_t::is_visible |
unsigned dict_col_t::len |
length; for MySQL data this is field->pack_length(), except that for a >= 5.0.3 type true VARCHAR this is the maximum byte length of the string data (in addition to the string, MySQL uses 1 or 2 bytes to store the string length)
unsigned dict_col_t::max_prefix |
maximum index prefix length on this column.
Our current max limit is 3072 (REC_VERSION_56_MAX_INDEX_COL_LEN) bytes.
unsigned dict_col_t::mbminmaxlen |
minimum and maximum length of a character, in bytes; DATA_MBMINMAXLEN(mbminlen,mbmaxlen); mbminlen=DATA_MBMINLEN(mbminmaxlen); mbmaxlen=DATA_MBMINLEN(mbminmaxlen)
unsigned dict_col_t::mtype |
main data type
unsigned dict_col_t::ord_part |
nonzero if this column appears in the ordering fields of an index
|
private |
unsigned dict_col_t::prtype |
precise type; MySQL data type, charset code, flags to indicate nullability, signedness, whether this is a binary string, whether this is a true VARCHAR where MySQL uses 2 bytes to store the length
|
private |
|
private |