MySQL  8.0.19
Source Code Documentation
dict_col_t Struct Reference

Data structure for a column in a table. More...

#include <dict0mem.h>

Public Member Functions

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 assert_equal (const dtype_t *type) const
 Assert that a column and a data type match. More...
 

Public Attributes

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

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_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_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

◆ 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_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

◆ 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

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

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.

◆ 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

◆ 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


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