MySQL 9.6.0
Source Code Documentation
dict_sys_t Struct Reference

#include <dict0dict.h>

Public Types

using Table_LRU_list_base = UT_LIST_BASE_NODE_T(dict_table_t, table_LRU)
 

Public Member Functions

virtual void dict_hdr_flush_row_id ()
 Writes the current value of the row id counter to the dictionary header file page. More...
 
virtual ~dict_sys_t ()=default
 
template<typename Functor >
void for_each_table (Functor &functor)
 Iterate each table. More...
 

Static Public Member Functions

static bool is_reserved (space_id_t space)
 Check if a tablespace id is a reserved tablespace ID. More...
 
static bool is_dd_table_id (table_id_t id)
 Check if a table is hardcoded. More...
 

Public Attributes

DictSysMutex mutex
 mutex protecting the data dictionary; protects also the disk-based dictionary system tables; this mutex serializes CREATE TABLE and DROP TABLE, as well as reading the dictionary data for a table from system tables More...
 
std::atomic< row_id_trow_id
 the next row id to assign; NOTE: we only update the DICT_HDR_ROW_ID header once for every DICT_HDR_ROW_ID_WRITE_MARGIN increments, which means that after crash recovery the value found in this header might be smaller than the value in some of the rows. More...
 
hash_table_ttable_hash
 hash table of the tables, based on name More...
 
hash_table_ttable_id_hash
 hash table of the tables, based on id More...
 
size_t size
 varying space in bytes occupied by the data dictionary table and index objects
More...
 
dict_table_ttable_stats
 Permanent handle to mysql.innodb_table_stats. More...
 
dict_table_tindex_stats
 Permanent handle to mysql.innodb_index_stats. More...
 
dict_table_tddl_log
 Permanent handle to mysql.innodb_ddl_log. More...
 
dict_table_tdynamic_metadata
 Permanent handle to mysql.innodb_dynamic_metadata. More...
 
Table_LRU_list_base table_LRU
 List of tables that can be evicted from the cache. More...
 
Table_LRU_list_base table_non_LRU
 List of tables that can't be evicted from the cache. More...
 

Static Public Attributes

static std::set< dd::Object_ids_dd_table_ids = {}
 Set of ids of DD tables. More...
 
static constexpr space_id_t s_log_space_id = 0xFFFFFFF0UL
 The first ID of the redo log pseudo-tablespace. More...
 
static constexpr space_id_t s_invalid_space_id = 0xFFFFFFFF
 Use maximum UINT value to indicate invalid space ID. More...
 
static constexpr space_id_t s_dict_space_id = 0xFFFFFFFE
 The data dictionary tablespace ID. More...
 
static constexpr space_id_t s_temp_space_id = 0xFFFFFFFD
 The innodb_temporary tablespace ID. More...
 
static constexpr space_id_t s_undo_space_id_range = 400000
 The number of space IDs dedicated to each undo tablespace. More...
 
static constexpr space_id_t s_min_undo_space_id
 The lowest undo tablespace ID. More...
 
static constexpr space_id_t s_max_undo_space_id = s_log_space_id - 1
 The highest undo tablespace ID. More...
 
static constexpr space_id_t s_max_temp_space_id = s_min_undo_space_id - 1
 Start space_ids for temporary tablespaces. More...
 
static constexpr space_id_t s_temp_space_id_range = 400000
 The number of space IDs dedicated to temporary tablespaces. More...
 
static constexpr space_id_t s_min_temp_space_id
 Lowest temporary general space id. More...
 
static constexpr space_id_t s_reserved_space_id = s_min_temp_space_id
 The first reserved tablespace ID. More...
 
static constexpr dd::Object_id s_dd_dict_space_id = 1
 The dd::Tablespace::id of the dictionary tablespace. More...
 
static constexpr dd::Object_id s_dd_sys_space_id = 2
 The dd::Tablespace::id of innodb_system. More...
 
static constexpr dd::Object_id s_dd_temp_space_id = 3
 The dd::Tablespace::id of innodb_temporary. More...
 
static const char * s_dd_space_name = "mysql"
 The name of the data dictionary tablespace. More...
 
static const char * s_dd_space_file_name = "mysql.ibd"
 The file name of the data dictionary tablespace. More...
 
static const char * s_sys_space_name = "innodb_system"
 The name of the hard-coded system tablespace. More...
 
static const char * s_temp_space_name = "innodb_temporary"
 The name of the predefined temporary tablespace. More...
 
static const char * s_temp_space_file_name = "ibtmp1"
 The file name of the predefined temporary tablespace. More...
 
static const char * s_file_per_table_name = "innodb_file_per_table"
 The hard-coded tablespace name innodb_file_per_table. More...
 
static const char * s_default_undo_space_name_1 = "innodb_undo_001"
 These two undo tablespaces cannot be dropped. More...
 
static const char * s_default_undo_space_name_2 = "innodb_undo_002"
 
static constexpr table_id_t s_dynamic_meta_table_id = 2
 The table ID of mysql.innodb_dynamic_metadata. More...
 
static constexpr space_index_t s_dynamic_meta_index_id = 2
 The clustered index ID of mysql.innodb_dynamic_metadata. More...
 

Member Typedef Documentation

◆ Table_LRU_list_base

Constructor & Destructor Documentation

◆ ~dict_sys_t()

virtual dict_sys_t::~dict_sys_t ( )
virtualdefault

Member Function Documentation

◆ dict_hdr_flush_row_id()

void dict_sys_t::dict_hdr_flush_row_id ( )
virtual

Writes the current value of the row id counter to the dictionary header file page.

◆ for_each_table()

template<typename Functor >
void dict_sys_t::for_each_table ( Functor &  functor)
inline

Iterate each table.

Template Parameters
Functorvisitor
Parameters
[in,out]functorto be invoked on each table

◆ is_dd_table_id()

static bool dict_sys_t::is_dd_table_id ( table_id_t  id)
inlinestatic

Check if a table is hardcoded.

it only includes the dd tables

Parameters
[in]idtable ID
Return values
trueif the table is a persistent hard-coded table (dict_table_t::is_temporary() will not hold)
falseif the table is not hard-coded (it can be persistent or temporary)

◆ is_reserved()

static bool dict_sys_t::is_reserved ( space_id_t  space)
inlinestatic

Check if a tablespace id is a reserved tablespace ID.

Parameters
[in]spacetablespace id to check
Returns
true if a reserved tablespace id, otherwise false

Member Data Documentation

◆ ddl_log

dict_table_t* dict_sys_t::ddl_log

Permanent handle to mysql.innodb_ddl_log.

◆ dynamic_metadata

dict_table_t* dict_sys_t::dynamic_metadata

Permanent handle to mysql.innodb_dynamic_metadata.

◆ index_stats

dict_table_t* dict_sys_t::index_stats

Permanent handle to mysql.innodb_index_stats.

◆ mutex

DictSysMutex dict_sys_t::mutex

mutex protecting the data dictionary; protects also the disk-based dictionary system tables; this mutex serializes CREATE TABLE and DROP TABLE, as well as reading the dictionary data for a table from system tables

◆ row_id

std::atomic<row_id_t> dict_sys_t::row_id

the next row id to assign; NOTE: we only update the DICT_HDR_ROW_ID header once for every DICT_HDR_ROW_ID_WRITE_MARGIN increments, which means that after crash recovery the value found in this header might be smaller than the value in some of the rows.

This is why we add DICT_HDR_ROW_ID_WRITE_MARGIN to it after recovery to prevent duplicates.

◆ s_dd_dict_space_id

constexpr dd::Object_id dict_sys_t::s_dd_dict_space_id = 1
staticconstexpr

The dd::Tablespace::id of the dictionary tablespace.

◆ s_dd_space_file_name

const char * dict_sys_t::s_dd_space_file_name = "mysql.ibd"
static

The file name of the data dictionary tablespace.

◆ s_dd_space_name

const char * dict_sys_t::s_dd_space_name = "mysql"
static

The name of the data dictionary tablespace.

◆ s_dd_sys_space_id

constexpr dd::Object_id dict_sys_t::s_dd_sys_space_id = 2
staticconstexpr

The dd::Tablespace::id of innodb_system.

◆ s_dd_table_ids

std::set< dd::Object_id > dict_sys_t::s_dd_table_ids = {}
static

Set of ids of DD tables.

The set of SE private IDs of DD tables.

Used to tell whether a table is a DD table. Since the DD tables can be rebuilt with new SE private IDs, this set replaces checks based on ranges of IDs.

◆ s_dd_temp_space_id

constexpr dd::Object_id dict_sys_t::s_dd_temp_space_id = 3
staticconstexpr

The dd::Tablespace::id of innodb_temporary.

◆ s_default_undo_space_name_1

const char * dict_sys_t::s_default_undo_space_name_1 = "innodb_undo_001"
static

These two undo tablespaces cannot be dropped.

◆ s_default_undo_space_name_2

const char * dict_sys_t::s_default_undo_space_name_2 = "innodb_undo_002"
static

◆ s_dict_space_id

constexpr space_id_t dict_sys_t::s_dict_space_id = 0xFFFFFFFE
staticconstexpr

The data dictionary tablespace ID.

◆ s_dynamic_meta_index_id

constexpr space_index_t dict_sys_t::s_dynamic_meta_index_id = 2
staticconstexpr

The clustered index ID of mysql.innodb_dynamic_metadata.

◆ s_dynamic_meta_table_id

constexpr table_id_t dict_sys_t::s_dynamic_meta_table_id = 2
staticconstexpr

The table ID of mysql.innodb_dynamic_metadata.

◆ s_file_per_table_name

const char * dict_sys_t::s_file_per_table_name = "innodb_file_per_table"
static

The hard-coded tablespace name innodb_file_per_table.

◆ s_invalid_space_id

constexpr space_id_t dict_sys_t::s_invalid_space_id = 0xFFFFFFFF
staticconstexpr

Use maximum UINT value to indicate invalid space ID.

◆ s_log_space_id

constexpr space_id_t dict_sys_t::s_log_space_id = 0xFFFFFFF0UL
staticconstexpr

The first ID of the redo log pseudo-tablespace.

◆ s_max_temp_space_id

constexpr space_id_t dict_sys_t::s_max_temp_space_id = s_min_undo_space_id - 1
staticconstexpr

Start space_ids for temporary tablespaces.

◆ s_max_undo_space_id

constexpr space_id_t dict_sys_t::s_max_undo_space_id = s_log_space_id - 1
staticconstexpr

The highest undo tablespace ID.

◆ s_min_temp_space_id

constexpr space_id_t dict_sys_t::s_min_temp_space_id
staticconstexpr
Initial value:
=
static constexpr space_id_t s_min_undo_space_id
The lowest undo tablespace ID.
Definition: dict0dict.h:1122
static constexpr space_id_t s_temp_space_id_range
The number of space IDs dedicated to temporary tablespaces.
Definition: dict0dict.h:1132

Lowest temporary general space id.

◆ s_min_undo_space_id

constexpr space_id_t dict_sys_t::s_min_undo_space_id
staticconstexpr
Initial value:
=
constexpr size_t FSP_MAX_UNDO_TABLESPACES
The maximum number of non-temporary Undo Tablespaces (implicit + explicit) that can exist at the same...
Definition: fsp0types.h:408
static constexpr space_id_t s_undo_space_id_range
The number of space IDs dedicated to each undo tablespace.
Definition: dict0dict.h:1119
static constexpr space_id_t s_log_space_id
The first ID of the redo log pseudo-tablespace.
Definition: dict0dict.h:1107

The lowest undo tablespace ID.

◆ s_reserved_space_id

constexpr space_id_t dict_sys_t::s_reserved_space_id = s_min_temp_space_id
staticconstexpr

The first reserved tablespace ID.

◆ s_sys_space_name

const char * dict_sys_t::s_sys_space_name = "innodb_system"
static

The name of the hard-coded system tablespace.

◆ s_temp_space_file_name

const char * dict_sys_t::s_temp_space_file_name = "ibtmp1"
static

The file name of the predefined temporary tablespace.

◆ s_temp_space_id

constexpr space_id_t dict_sys_t::s_temp_space_id = 0xFFFFFFFD
staticconstexpr

The innodb_temporary tablespace ID.

◆ s_temp_space_id_range

constexpr space_id_t dict_sys_t::s_temp_space_id_range = 400000
staticconstexpr

The number of space IDs dedicated to temporary tablespaces.

◆ s_temp_space_name

const char * dict_sys_t::s_temp_space_name = "innodb_temporary"
static

The name of the predefined temporary tablespace.

◆ s_undo_space_id_range

constexpr space_id_t dict_sys_t::s_undo_space_id_range = 400000
staticconstexpr

The number of space IDs dedicated to each undo tablespace.

◆ size

size_t dict_sys_t::size

varying space in bytes occupied by the data dictionary table and index objects

◆ table_hash

hash_table_t* dict_sys_t::table_hash

hash table of the tables, based on name

◆ table_id_hash

hash_table_t* dict_sys_t::table_id_hash

hash table of the tables, based on id

◆ table_LRU

Table_LRU_list_base dict_sys_t::table_LRU

List of tables that can be evicted from the cache.

◆ table_non_LRU

Table_LRU_list_base dict_sys_t::table_non_LRU

List of tables that can't be evicted from the cache.

◆ table_stats

dict_table_t* dict_sys_t::table_stats

Permanent handle to mysql.innodb_table_stats.


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