MySQL 8.0.32
Source Code Documentation
dict_col_t Struct Reference

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_tinstant_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}
 

Detailed Description

Data structure for a column in a table.

Member Function Documentation

◆ assert_equal()

bool dict_col_t::assert_equal ( const dtype_t type) const
inline

Assert that a column and a data type match.

param[in] type data type

Returns
true

◆ copy_type()

void dict_col_t::copy_type ( dtype_t type) const
inline

Gets the column data type.

Parameters
[out]typedata type

◆ get_col_phy_pos()

uint16_t dict_col_t::get_col_phy_pos ( ) const
inline

◆ get_fixed_size()

ulint dict_col_t::get_fixed_size ( ulint  comp) const
inline

Returns the size of a fixed size column, 0 if not a fixed size column.

Parameters
[in]compnonzero=ROW_FORMAT=COMPACT
Returns
fixed size, or 0

◆ get_max_size()

ulint dict_col_t::get_max_size ( ) const
inline

Returns the maximum size of the column.

Returns
maximum size

◆ get_mbmaxlen()

ulint dict_col_t::get_mbmaxlen ( ) const
inline

Gets the maximum number of bytes per character.

Returns
maximum multi-byte char size, in bytes

◆ get_mbminlen()

ulint dict_col_t::get_mbminlen ( ) const
inline

Gets the minimum number of bytes per character.

Returns
minimum multi-byte char size, in bytes

◆ get_min_size()

ulint dict_col_t::get_min_size ( ) const
inline

Returns the minimum size of the column.

Returns
minimum size

◆ get_null_size()

ulint dict_col_t::get_null_size ( ulint  comp) const
inline

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.

Parameters
[in]compnonzero=ROW_FORMAT=COMPACT
Returns
SQL null storage size in ROW_FORMAT=REDUNDANT

◆ get_phy_pos()

uint32_t dict_col_t::get_phy_pos ( ) const
inline

◆ get_prefix_phy_pos()

uint16_t dict_col_t::get_prefix_phy_pos ( ) const
inline

◆ get_spatial_status()

spatial_status_t dict_col_t::get_spatial_status ( ) const
inline

Check whether the col is used in spatial index or regular index.

Returns
spatial status

◆ get_version_added()

uint8_t dict_col_t::get_version_added ( ) const
inline

◆ get_version_dropped()

uint8_t dict_col_t::get_version_dropped ( ) const
inline

◆ has_prefix_phy_pos()

bool dict_col_t::has_prefix_phy_pos ( ) const
inline

◆ is_added_after()

bool dict_col_t::is_added_after ( uint8_t  version) const
inline

Check if column is added after the current version.

Parameters
[in]versionrow version
Returns
true if column is added after the current row version.

◆ is_dropped_in_or_before()

bool dict_col_t::is_dropped_in_or_before ( uint8_t  version) const
inline

Check if column is dropped before the given version.

Parameters
[in]versionrow version
Returns
true if the column is dropped before or in the version.

◆ is_instant_added()

bool dict_col_t::is_instant_added ( ) const
inline

◆ is_instant_dropped()

bool dict_col_t::is_instant_dropped ( ) const
inline

◆ is_instant_dropped_name()

static bool dict_col_t::is_instant_dropped_name ( const std::string  col_name)
inlinestatic

Check if a column name resembles format for dropped column.

param[in] type column name

Returns
true if column name resembles dropped column.

◆ is_multi_value()

bool dict_col_t::is_multi_value ( ) const
inline

Check if a column is a multi-value virtual column.

Returns
true if it is a multi-value virtual column, false otherwise

◆ is_nullable()

bool dict_col_t::is_nullable ( ) const
inline

Check if a column is nullable.

Returns
true if it is nullable, otherwise false

◆ is_version_added_match()

bool dict_col_t::is_version_added_match ( const dict_col_t col) const
inline

◆ is_version_dropped_match()

bool dict_col_t::is_version_dropped_match ( const dict_col_t col) const
inline

◆ is_virtual()

bool dict_col_t::is_virtual ( ) const
inline

Check if a column is a virtual column.

Returns
true if it is a virtual column, false otherwise

◆ is_visible_in_version()

bool dict_col_t::is_visible_in_version ( uint8_t  version) const
inline

Check if a column is visible in given version.

Parameters
[in]versionrow version return true if column is visible in version.

◆ set_col_phy_pos()

void dict_col_t::set_col_phy_pos ( uint16_t  pos)
inline

◆ set_default()

void dict_col_t::set_default ( const byte value,
size_t  length,
mem_heap_t heap 
)

Set default value.

Parameters
[in]valueDefault value
[in]lengthDefault value length
[in,out]heapHeap to allocate memory

◆ set_mbminmaxlen()

void dict_col_t::set_mbminmaxlen ( ulint  mbminlen,
ulint  mbmaxlen 
)
inline

Sets the minimum and maximum number of bytes per character.

Parameters
[in]mbminlenminimum multi byte character size, in bytes
[in]mbmaxlenmAXimum multi-byte character size, in bytes

◆ set_phy_pos()

void dict_col_t::set_phy_pos ( uint32_t  pos)
inline

◆ set_prefix_phy_pos()

void dict_col_t::set_prefix_phy_pos ( uint16_t  prefix_pos)
inline

◆ set_version_added()

void dict_col_t::set_version_added ( uint8_t  version)
inline

◆ set_version_dropped()

void dict_col_t::set_version_dropped ( uint8_t  version)
inline

Member Data Documentation

◆ ind

unsigned dict_col_t::ind

table column position (starting from 0)

◆ instant_default

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.

◆ is_visible

bool dict_col_t::is_visible

◆ len

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)

◆ max_prefix

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.

◆ mbminmaxlen

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)

◆ mtype

unsigned dict_col_t::mtype

main data type

◆ ord_part

unsigned dict_col_t::ord_part

nonzero if this column appears in the ordering fields of an index

◆ phy_pos

uint32_t dict_col_t::phy_pos {UINT32_UNDEFINED}
private

◆ prtype

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

◆ version_added

uint8_t dict_col_t::version_added {UINT8_UNDEFINED}
private

◆ version_dropped

uint8_t dict_col_t::version_dropped {UINT8_UNDEFINED}
private

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