MySQL 8.0.39
Source Code Documentation
dict0types.h File Reference

Data dictionary global types. More...

#include "fsp0types.h"
#include "ibuf0types.h"
#include "mysql_com.h"
#include "rem0types.h"
#include "ut0mutex.h"

Go to the source code of this file.

Classes

struct  table_name_components
 
class  index_id_t
 Globally unique index identifier. More...
 

Namespaces

namespace  dd
 The version of the current data dictionary table definitions.
 
namespace  dict_name
 Innodb data dictionary name.
 

Macros

#define TEMP_FILE_PREFIX   "#sql"
 Prefix for tmp tables, adopted from sql/table.h. More...
 
#define TEMP_FILE_PREFIX_LENGTH   4
 
#define TEMP_FILE_PREFIX_INNODB   "#sql-ib"
 
#define TEMP_TABLE_PREFIX   "#sql"
 
#define TEMP_TABLE_PATH_PREFIX   "/" TEMP_TABLE_PREFIX
 

Typedefs

using dict_name::Convert_Func = std::function< void(std::string &)>
 Name string conversion callback. More...
 
typedef ib_id_t table_id_t
 Table or partition identifier (unique within an InnoDB instance). More...
 
typedef ib_id_t space_index_t
 Index identifier (unique within a tablespace). More...
 
typedef ib_mutex_t DictSysMutex
 

Enumerations

enum  dict_err_ignore_t {
  DICT_ERR_IGNORE_NONE = 0 , DICT_ERR_IGNORE_INDEX_ROOT = 1 , DICT_ERR_IGNORE_CORRUPT = 2 , DICT_ERR_IGNORE_FK_NOKEY = 4 ,
  DICT_ERR_IGNORE_RECOVER_LOCK = 8 , DICT_ERR_IGNORE_ALL = 0xFFFF
}
 Error to ignore when we load table dictionary into memory. More...
 
enum  ib_quiesce_t { QUIESCE_NONE , QUIESCE_START , QUIESCE_COMPLETE }
 Quiescing states for flushing tables to disk. More...
 
enum  spatial_status_t { SPATIAL_UNKNOWN = 0 , SPATIAL_NONE = 1 , SPATIAL_MIXED = 2 , SPATIAL_ONLY = 3 }
 whether a col is used in spatial index or regular index Note: the spatial status is part of persistent undo log, so we should not modify the values in MySQL 5.7 More...
 

Functions

void dict_name::file_to_table (std::string &name, bool quiet)
 Conversion function to change for system to file name cs. More...
 
void dict_name::table_to_file (std::string &name)
 Conversion function to change for file name to system cs. More...
 
bool dict_name::is_partition (const std::string &dict_name)
 Check if it is a table partition. More...
 
void dict_name::get_table (const std::string &dict_name, bool convert, std::string &schema, std::string &table, std::string &partition, bool &is_tmp)
 Get schema, table name, partition string and temporary attribute from dictionary table name. More...
 
void dict_name::get_table (const std::string &dict_name, std::string &schema, std::string &table)
 Get schema and table name from dictionary table name. More...
 
std::optional< table_name_componentsdict_name::parse_tablespace_path (std::string path)
 Get schema, table name, partition, subpartition and absolute directory from dictionary from filepath. More...
 
void dict_name::get_partition (const std::string &partition, bool convert, std::string &part, std::string &sub_part)
 Get partition and sub-partition name from partition string. More...
 
void dict_name::build_table (const std::string &schema, const std::string &table, const std::string &partition, bool is_tmp, bool convert, std::string &dict_name)
 
void dict_name::build_partition (const dd::Partition *dd_part, std::string &partition)
 Build partition string from dd object. More...
 
void dict_name::build_57_partition (const dd::Partition *dd_part, std::string &partition)
 Build 5.7 style partition string from dd object. More...
 
bool dict_name::match_partition (const std::string &dict_name, const dd::Partition *dd_part)
 Check if dd partition matches with innodb dictionary table name. More...
 
void dict_name::convert_to_space (std::string &dict_name)
 
void dict_name::rebuild_space (const std::string &dict_name, std::string &space_name)
 
void dict_name::rebuild (std::string &dict_name)
 Rebuild table name to convert from 5.7 format to 8.0. More...
 
std::ostream & operator<< (std::ostream &out, const index_id_t &id)
 Display an index identifier. More...
 

Variables

constexpr char dict_name::PART_SEPARATOR [] = "#p#"
 Partition separator in dictionary table name and file name. More...
 
constexpr size_t dict_name::PART_SEPARATOR_LEN = sizeof(PART_SEPARATOR) - 1
 Partition separator length excluding terminating NULL. More...
 
constexpr char dict_name::SUB_PART_SEPARATOR [] = "#sp#"
 Sub-Partition separator in dictionary table name and file name. More...
 
constexpr size_t dict_name::SUB_PART_SEPARATOR_LEN = sizeof(SUB_PART_SEPARATOR) - 1
 Sub-Partition separator length excluding terminating NULL. More...
 
constexpr char dict_name::ALT_PART_SEPARATOR [] = "#P#"
 Alternative partition separator from 8.0.17 and older versions. More...
 
constexpr char dict_name::ALT_SUB_PART_SEPARATOR [] = "#SP#"
 Alternative sub-partition separator from 8.0.17 and older versions. More...
 
constexpr char dict_name::SCHEMA_SEPARATOR [] = "/"
 Schema separator is forward slash irrespective of platform. More...
 
constexpr size_t dict_name::SCHEMA_SEPARATOR_LEN = sizeof(SCHEMA_SEPARATOR) - 1
 
constexpr size_t dict_name::MAX_DB_UTF8MB3_LEN = NAME_LEN + 1
 The maximum length in bytes that a database name can occupy when stored in UTF8MB3, including the terminating null. More...
 
constexpr size_t dict_name::MAX_DB_CHAR_LEN = NAME_CHAR_LEN
 The maximum length in characters for database name. More...
 
constexpr size_t dict_name::MAX_TABLE_UTF8MB3_LEN
 The maximum length in bytes that a table name can occupy when stored in UTF8MB3, including the terminating null. More...
 
constexpr size_t dict_name::MAX_TABLE_CHAR_LEN
 The maximum length in characters for table name. More...
 
constexpr char dict_name::TMP_POSTFIX [] = "#tmp"
 Postfix for a table name which is being altered. More...
 
constexpr size_t dict_name::TMP_POSTFIX_LEN = sizeof(TMP_POSTFIX) - 1
 
constexpr size_t dict_name::MAX_SPACE_NAME_LEN
 Maximum space name length. More...
 
constexpr uint32_t DICT_HDR_SPACE = 0
 
constexpr uint32_t DICT_HDR_PAGE_NO = FSP_DICT_HDR_PAGE_NO
 
constexpr uint64_t DICT_IBUF_ID_MIN = 0xFFFFFFFF00000000ULL
 
uint ibuf_debug
 Flag to control insert buffer debugging. More...
 
constexpr uint32_t SPATIAL_STATUS_SHIFT = 12
 Shift for spatial status. More...
 
constexpr uint32_t SPATIAL_STATUS_MASK = 3 << SPATIAL_STATUS_SHIFT
 Mask to encode/decode spatial status. More...
 

Detailed Description

Data dictionary global types.

Created 1/8/1996 Heikki Tuuri

Macro Definition Documentation

◆ TEMP_FILE_PREFIX

#define TEMP_FILE_PREFIX   "#sql"

Prefix for tmp tables, adopted from sql/table.h.

◆ TEMP_FILE_PREFIX_INNODB

#define TEMP_FILE_PREFIX_INNODB   "#sql-ib"

◆ TEMP_FILE_PREFIX_LENGTH

#define TEMP_FILE_PREFIX_LENGTH   4

◆ TEMP_TABLE_PATH_PREFIX

#define TEMP_TABLE_PATH_PREFIX   "/" TEMP_TABLE_PREFIX

◆ TEMP_TABLE_PREFIX

#define TEMP_TABLE_PREFIX   "#sql"

Typedef Documentation

◆ DictSysMutex

typedef ib_mutex_t DictSysMutex

◆ space_index_t

Index identifier (unique within a tablespace).

◆ table_id_t

Table or partition identifier (unique within an InnoDB instance).

Enumeration Type Documentation

◆ dict_err_ignore_t

Error to ignore when we load table dictionary into memory.

However, the table and index will be marked as "corrupted", and caller will be responsible to deal with corrupted table or index. Note: please define the IGNORE_ERR_* as bits, so their value can be or-ed together

Enumerator
DICT_ERR_IGNORE_NONE 

no error to ignore

DICT_ERR_IGNORE_INDEX_ROOT 

ignore error if index root page is FIL_NULL or incorrect value

DICT_ERR_IGNORE_CORRUPT 

skip corrupted indexes

DICT_ERR_IGNORE_FK_NOKEY 

ignore error if any foreign key is missing

DICT_ERR_IGNORE_RECOVER_LOCK 

Used when recovering table locks for resurrected transactions.

Silently load a missing tablespace, and do not load incomplete index definitions.

DICT_ERR_IGNORE_ALL 

ignore all errors

◆ ib_quiesce_t

Quiescing states for flushing tables to disk.

Enumerator
QUIESCE_NONE 
QUIESCE_START 

Initialise, prepare to start.

QUIESCE_COMPLETE 

All done.

◆ spatial_status_t

whether a col is used in spatial index or regular index Note: the spatial status is part of persistent undo log, so we should not modify the values in MySQL 5.7

Enumerator
SPATIAL_UNKNOWN 
SPATIAL_NONE 

Not used in gis index.

SPATIAL_MIXED 

Used in both spatial index and regular index.

SPATIAL_ONLY 

Only used in spatial index.

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const index_id_t id 
)
inline

Display an index identifier.

Parameters
[in,out]outthe output stream
[in]idindex identifier
Returns
the output stream

Variable Documentation

◆ DICT_HDR_PAGE_NO

constexpr uint32_t DICT_HDR_PAGE_NO = FSP_DICT_HDR_PAGE_NO
constexpr

◆ DICT_HDR_SPACE

constexpr uint32_t DICT_HDR_SPACE = 0
constexpr

◆ DICT_IBUF_ID_MIN

constexpr uint64_t DICT_IBUF_ID_MIN = 0xFFFFFFFF00000000ULL
constexpr

◆ ibuf_debug

uint ibuf_debug
extern

Flag to control insert buffer debugging.

◆ SPATIAL_STATUS_MASK

constexpr uint32_t SPATIAL_STATUS_MASK = 3 << SPATIAL_STATUS_SHIFT
constexpr

Mask to encode/decode spatial status.

◆ SPATIAL_STATUS_SHIFT

constexpr uint32_t SPATIAL_STATUS_SHIFT = 12
constexpr

Shift for spatial status.