MySQL 8.0.39
Source Code Documentation
mem.h File Reference

Data dictionary memory object creation. More...

Go to the source code of this file.

Functions

dict_table_tdict_mem_table_create (const char *name, space_id_t space, ulint n_cols, ulint n_v_cols, ulint n_m_v_cols, uint32_t flags, uint32_t flags2, uint32_t n_drop_cols=0)
 Creates a table memory object. More...
 
void dict_mem_table_free (dict_table_t *table)
 Free a table memory object. More...
 
dict_index_tdict_mem_index_create (const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
 Creates an index memory object. More...
 
void dict_mem_table_add_col (dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len, bool is_visible, uint32_t phy_pos=UINT32_UNDEFINED, uint8_t v_added=UINT8_UNDEFINED, uint8_t v_dropped=UINT8_UNDEFINED)
 Adds a column definition to a table. More...
 
void dict_mem_fill_column_struct (dict_col_t *column, ulint col_pos, ulint mtype, ulint prtype, ulint col_len, bool is_visible, uint32_t phy_pos, uint8_t v_added, uint8_t v_dropped)
 This function populates a dict_col_t memory structure with supplied information. More...
 
const char * dict_add_col_name (const char *col_names, ulint cols, const char *name, mem_heap_t *heap)
 Append 'name' to 'col_names'. More...
 

Detailed Description

Data dictionary memory object creation.

Created 1/8/1996 Heikki Tuuri

Function Documentation

◆ dict_add_col_name()

const char * dict_add_col_name ( const char *  col_names,
ulint  cols,
const char *  name,
mem_heap_t heap 
)

Append 'name' to 'col_names'.

See also
dict_table_t::col_names
Returns
new column names array in: heap

Append 'name' to 'col_names'.

The code in this file is used to make a library for external tools. Append 'name' to 'col_names'.

See also
dict_table_t::col_names
Returns
new column names array
Parameters
col_namesin: existing column names, or NULL
colsin: number of existing columns
namein: new column name
heapin: heap

◆ dict_mem_fill_column_struct()

void dict_mem_fill_column_struct ( dict_col_t column,
ulint  col_pos,
ulint  mtype,
ulint  prtype,
ulint  col_len,
bool  is_visible,
uint32_t  phy_pos,
uint8_t  v_added,
uint8_t  v_dropped 
)

This function populates a dict_col_t memory structure with supplied information.

Parameters
[out]columncolumn struct to be filled
[in]col_poscolumn position
[in]mtypemain data type
[in]prtypeprecise type
[in]col_lencolumn length
[in]is_visibletrue if column is visible
[in]phy_posposition of col in physical record
[in]v_addedtable row version when col was added INSTANTly
[in]v_droppedtable row version when col was dropped INSTANTly

◆ dict_mem_index_create()

dict_index_t * dict_mem_index_create ( const char *  table_name,
const char *  index_name,
ulint  space,
ulint  type,
ulint  n_fields 
)

Creates an index memory object.

Returns
own: index object in: number of fields
own: index object
Parameters
table_namein: table name
index_namein: index name
spacein: space where the index tree is placed, ignored if the index is of the clustered type
typein: DICT_UNIQUE, DICT_CLUSTERED, ... ORed
n_fieldsin: number of fields

◆ dict_mem_table_add_col()

void dict_mem_table_add_col ( dict_table_t table,
mem_heap_t heap,
const char *  name,
ulint  mtype,
ulint  prtype,
ulint  len,
bool  is_visible,
uint32_t  phy_pos = UINT32_UNDEFINED,
uint8_t  v_added = UINT8_UNDEFINED,
uint8_t  v_dropped = UINT8_UNDEFINED 
)

Adds a column definition to a table.

Parameters
[in]tabletable
[in]heaptemporary memory heap, or NULL
[in]namecolumn name, or NULL
[in]mtypemain datatype
[in]prtypeprecise type
[in]lenlength of column
[in]is_visibletrue if column is visible
[in]phy_posposition of col in physical record
[in]v_addedtable row version when col was added INSTANTly
[in]v_droppedtable_row version when col was dropped INSTANTly

◆ dict_mem_table_create()

dict_table_t * dict_mem_table_create ( const char *  name,
space_id_t  space,
ulint  n_cols,
ulint  n_v_cols,
ulint  n_m_v_cols,
uint32_t  flags,
uint32_t  flags2,
uint32_t  n_drop_cols = 0 
)

Creates a table memory object.

Parameters
[in]nametable name
[in]spacespace where the clustered index of the table is placed
[in]n_colstotal number of columns including virtual and non-virtual columns
[in]n_v_colsnumber of virtual columns
[in]n_m_v_colsnumber of multi-value virtual columns
[in]flagstable flags
[in]flags2table flags2
[in]n_drop_colsNumber of INSTANT drop cols
Returns
own: table object

◆ dict_mem_table_free()

void dict_mem_table_free ( dict_table_t table)

Free a table memory object.

in: table

Parameters
tablein: table