MySQL 8.3.0
Source Code Documentation
dict0mem.h File Reference

Data dictionary memory object creation. More...

#include "sql/dd/object_id.h"
#include "sql/dd/types/column.h"
#include "univ.i"
#include "btr0types.h"
#include "data0type.h"
#include "dict0types.h"
#include "mem0mem.h"
#include "rem0types.h"
#include "row0types.h"
#include "lock0types.h"
#include "que0types.h"
#include "hash0hash.h"
#include "sync0rw.h"
#include "trx0types.h"
#include "ut0byte.h"
#include "ut0mem.h"
#include "ut0rnd.h"
#include "fts0fts.h"
#include "buf0buf.h"
#include "gis0type.h"
#include "os0once.h"
#include "dict/mem.h"
#include "ut0new.h"
#include "sql/sql_const.h"
#include "sql/table.h"
#include <algorithm>
#include <iterator>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "dict0mem.ic"

Go to the source code of this file.

Classes

class  id_name_t
 SQL identifier name wrapper for pretty-printing. More...
 
struct  table_name_t
 Table name wrapper for pretty-printing. More...
 
struct  dict_col_default_t
 Data structure for default value of a column in a table. More...
 
struct  dict_col_t
 Data structure for a column in a table. More...
 
struct  dict_v_idx_t
 Index information put in a list of virtual column structure. More...
 
struct  dict_v_col_t
 Data structure for a virtual column in a table. More...
 
struct  dict_add_v_col_t
 Data structure for newly added virtual column in a table. More...
 
struct  dict_s_col_t
 Data structure for a stored column in a table. More...
 
struct  dict_field_t
 Data structure for a field in an index. More...
 
struct  zip_pad_info_t
 Data structure to hold information about about how much space in an uncompressed page should be left as padding to avoid compression failures. More...
 
struct  rec_cache_t
 If key is fixed length key then cache the record offsets on first computation. More...
 
class  last_ops_cur_t
 Cache position of last inserted or selected record by caching record and holding reference to the block where record resides. More...
 
struct  dict_index_t
 Data structure for an index. More...
 
struct  dict_foreign_t
 Data structure for a foreign key constraint; an example: FOREIGN KEY (A, B) REFERENCES TABLE2 (C, D). More...
 
struct  dict_foreign_print
 
struct  dict_foreign_compare
 Compare two dict_foreign_t objects using their ids. More...
 
struct  dict_foreign_with_index
 A function object to find a foreign key with the given index as the referenced index. More...
 
struct  dict_foreign_different_tables
 
struct  dict_foreign_not_exists
 Function object to check if a foreign key object is there in the given foreign key set or not. More...
 
struct  dict_foreign_set_free
 The destructor will free all the foreign key constraints in the set by calling dict_foreign_free() on each of the foreign key constraints. More...
 
struct  dict_vcol_templ_t
 Structure defines template related to virtual columns and their base columns. More...
 
struct  dict_table_t
 Data structure for a database table. More...
 
class  PersistentTableMetadata
 Persistent dynamic metadata for a table. More...
 
class  Persister
 Interface for persistent dynamic table metadata. More...
 
class  CorruptedIndexPersister
 Persister used for corrupted indexes. More...
 
class  AutoIncPersister
 Persister used for autoinc counters. More...
 
class  Persisters
 Container of persisters used in the system. More...
 
struct  dict_foreign_add_to_referenced_table
 A function object to add the foreign key constraint to the referenced set of the referenced table, if it exists in the dictionary cache. More...
 

Namespaces

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

Macros

#define DICT_MAX_FIELD_LEN_BY_FORMAT(table)
 Find out maximum indexed column length by its table format. More...
 
#define DICT_STATS_PERSISTENT_ON   (1 << 1)
 The two bits below are set in the 'stat_persistent' member. More...
 
#define DICT_STATS_PERSISTENT_OFF   (1 << 2)
 
#define DICT_STATS_AUTO_RECALC_ON   (1 << 1)
 The two bits below are set in the 'stats_auto_recalc' member. More...
 
#define DICT_STATS_AUTO_RECALC_OFF   (1 << 2)
 
#define BG_STAT_NONE   0
 Background stats thread is not working on this table. More...
 
#define BG_STAT_IN_PROGRESS   (1 << 0)
 Set in 'stats_bg_flag' when the background stats code is working on this table. More...
 
#define BG_STAT_SHOULD_QUIT   (1 << 1)
 Set in 'stats_bg_flag' when DROP TABLE starts waiting on BG_STAT_IN_PROGRESS to be cleared. More...
 

Typedefs

typedef std::list< dict_v_idx_t, ut::allocator< dict_v_idx_t > > dict_v_idx_list
 Index list to put in dict_v_col_t. More...
 
typedef std::list< dict_s_col_t, ut::allocator< dict_s_col_t > > dict_s_col_list
 list to put stored column for dict_table_t More...
 
typedef std::set< dict_v_col_t *, std::less< dict_v_col_t * >, ut::allocator< dict_v_col_t * > > dict_vcol_set
 Set to store the virtual columns which are affected by Foreign key constraint. More...
 
typedef std::set< dict_foreign_t *, dict_foreign_compare, ut::allocator< dict_foreign_t * > > dict_foreign_set
 
typedef ut_list_base< lock_t, TableLockGetNodetable_lock_list_t
 
typedef std::vector< row_prebuilt_t * > temp_prebuilt_vec
 A vector to collect prebuilt from different readers working on the same temp table. More...
 
typedef std::vector< index_id_t, ut::allocator< index_id_t > > corrupted_ids_t
 

Enumerations

enum  online_index_status { ONLINE_INDEX_COMPLETE = 0 , ONLINE_INDEX_CREATION , ONLINE_INDEX_ABORTED , ONLINE_INDEX_ABORTED_DROPPED }
 The status of online index creation. More...
 
enum  table_dirty_status { METADATA_DIRTY = 0 , METADATA_BUFFERED , METADATA_CLEAN }
 The dirty status of tables, used to indicate if a table has some dynamic metadata changed to be written back. More...
 
enum  persistent_type_t { PM_SMALLEST_TYPE = 0 , PM_INDEX_CORRUPTED = 1 , PM_TABLE_AUTO_INC = 2 , PM_BIGGEST_TYPE = 3 }
 Persistent dynamic metadata type, there should be 1 to 1 relationship between the metadata and the type. More...
 

Functions

dict_v_col_tdict_mem_table_add_v_col (dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len, ulint pos, ulint num_base, bool is_visible)
 Adds a virtual column definition to a table. More...
 
void dict_mem_table_add_s_col (dict_table_t *table, ulint num_base)
 Adds a stored column definition to a table. More...
 
void dict_mem_table_col_rename (dict_table_t *table, ulint nth_col, const char *from, const char *to, bool is_virtual)
 Renames a column of a table in the data dictionary cache. More...
 
static void dict_mem_fill_index_struct (dict_index_t *index, mem_heap_t *heap, const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
 This function poplulates a dict_index_t index memory structure with supplied information. More...
 
void dict_mem_index_free (dict_index_t *index)
 Frees an index memory object. More...
 
dict_foreign_tdict_mem_foreign_create (void)
 Creates and initializes a foreign constraint memory object. More...
 
void dict_mem_foreign_table_name_lookup_set (dict_foreign_t *foreign, bool do_alloc)
 Sets the foreign_table_name_lookup pointer based on the value of lower_case_table_names. More...
 
void dict_mem_referenced_table_name_lookup_set (dict_foreign_t *foreign, bool do_alloc)
 Sets the referenced_table_name_lookup pointer based on the value of lower_case_table_names. More...
 
void dict_mem_foreign_fill_vcol_set (dict_foreign_t *foreign)
 Fills the dependent virtual columns in a set. More...
 
void dict_mem_table_fill_foreign_vcol_set (dict_table_t *table)
 Fill virtual columns set in each fk constraint present in the table. More...
 
void dict_mem_table_free_foreign_vcol_set (dict_table_t *table)
 Free the vcol_set from all foreign key constraint on the table. More...
 
char * dict_mem_create_temporary_tablename (mem_heap_t *heap, const char *dbtab, table_id_t id)
 Create a temporary tablename like "#sql-ibtid-inc" where tid = the Table ID inc = a randomly initialized number that is incremented for each file The table ID is a 64 bit integer, can use up to 20 digits, and is initialized at bootstrap. More...
 
static bool is_valid_row_version (const uint8_t version)
 
void dict_mem_init (void)
 Initialize dict memory variables. More...
 
static uint32_t DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG (uint32_t flags)
 
std::ostream & operator<< (std::ostream &out, const dict_foreign_t &foreign)
 
std::ostream & operator<< (std::ostream &out, const dict_foreign_set &fk_set)
 
bool dict_foreign_set_validate (const dict_foreign_set &fk_set)
 Validate the search order in the foreign key set. More...
 
bool dict_foreign_set_validate (const dict_table_t &table)
 Validate the search order in the foreign key sets of the table (foreign_set and referenced_set). More...
 
void dict_foreign_free (dict_foreign_t *foreign)
 Frees a foreign key struct. More...
 
std::ostream & operator<< (std::ostream &s, const id_name_t &id_name)
 Display an identifier. More...
 
std::ostream & operator<< (std::ostream &s, const table_name_t &table_name)
 Display a table name. More...
 
static void DICT_TF2_FLAG_SET (dict_table_t *table, uint32_t flag)
 
static bool DICT_TF2_FLAG_IS_SET (const dict_table_t *table, uint32_t flag)
 
static void DICT_TF2_FLAG_UNSET (dict_table_t *table, uint32_t flag)
 
void dict_table_mutex_create_lazy (dict_table_t *table)
 Request for lazy creation of the mutex of a given table. More...
 
void dict_table_mutex_destroy (dict_table_t *table)
 Destroy the mutex of a given table. More...
 
void dict_table_autoinc_destroy (dict_table_t *table)
 Destroy the autoinc latch of the given table. More...
 
void dict_table_autoinc_create_lazy (dict_table_t *table)
 Request for lazy creation of the autoinc latch of a given table. More...
 
void dict_index_zip_pad_mutex_create_lazy (dict_index_t *index)
 Request a lazy creation of dict_index_t::zip_pad::mutex. More...
 
void dict_index_zip_pad_mutex_destroy (dict_index_t *index)
 Destroy the zip_pad_mutex of the given index. More...
 
void dict_index_zip_pad_unlock (dict_index_t *index)
 Release the zip_pad_mutex of a given index. More...
 
bool dict_table_autoinc_own (const dict_table_t *table)
 Check if the current thread owns the autoinc_mutex of a given table. More...
 

Variables

constexpr char INSTANT_DROP_SUFFIX_8_0_29 [] = "_dropped_v"
 Format of INSTANTLY DROPPED column names. More...
 
constexpr char INSTANT_DROP_PREFIX_8_0_32 [] = "!hidden!_dropped_"
 
constexpr char RECOVERY_INDEX_TABLE_NAME [] = "LOG_DUMMY"
 index/table name used while applying REDO logs during recovery More...
 
constexpr uint32_t DICT_FK_MAX_RECURSIVE_LOAD = 20
 Tables could be chained together with Foreign key constraint. More...
 
constexpr uint32_t FK_MAX_CASCADE_DEL = 15
 Similarly, when tables are chained together with foreign key constraints with on cascading delete/update clause, delete from parent table could result in recursive cascading calls. More...
 
const uint8_t MAX_ROW_VERSION = 64
 Maximum number of rows version allowed when columns are added/dropped INSTANTly. More...
 
constexpr uint32_t DICT_ANTELOPE_MAX_INDEX_COL_LEN
 DICT_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and is the maximum indexed column length (or indexed prefix length) in ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT. More...
 
constexpr uint32_t DICT_MAX_FIXED_COL_LEN = DICT_ANTELOPE_MAX_INDEX_COL_LEN
 Defines the maximum fixed length column size. More...
 
constexpr uint32_t ZIP_PAD_ROUND_LEN = 128
 PADDING HEURISTIC BASED ON LINEAR INCREASE OF PADDING TO AVOID COMPRESSION FAILURES (Note: this is relevant only for compressed indexes) GOAL: Avoid compression failures by maintaining information about the compressibility of data. More...
 
constexpr uint32_t ZIP_PAD_SUCCESSFUL_ROUND_LIMIT = 5
 Number of successful rounds after which the padding is decreased. More...
 
constexpr uint32_t ZIP_PAD_INCR = 128
 Amount by which padding is increased. More...
 
ulong zip_failure_threshold_pct
 Percentage of compression failures that are allowed in a single round. More...
 
ulong zip_pad_max
 Maximum percentage of a page that can be allowed as a pad to avoid compression failures. More...
 
const char innobase_index_reserve_name [] = "GEN_CLUST_INDEX"
 "GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key. More...
 
constexpr uint32_t DICT_INDEX_MAGIC_N = 76789786
 Value of dict_index_t::magic_n. More...
 
constexpr uint32_t DICT_INDEX_MERGE_THRESHOLD_DEFAULT = 50
 
constexpr uint32_t MAX_KEY_LENGTH_BITS = 12
 
constexpr uint32_t DICT_TABLE_MAGIC_N = 76333786
 Value of 'magic_n'. More...
 
constexpr uint32_t DICT_CLUSTERED = 1
 Type flags of an index: OR'ing of the flags is allowed to define a combination of types. More...
 
constexpr uint32_t DICT_UNIQUE = 2
 unique index More...
 
constexpr uint32_t DICT_IBUF = 8
 insert buffer tree More...
 
constexpr uint32_t DICT_CORRUPT = 16
 bit to store the corrupted flag in SYS_INDEXES.TYPE More...
 
constexpr uint32_t DICT_FTS = 32
 FTS index; can't be combined with the other flags. More...
 
constexpr uint32_t DICT_SPATIAL = 64
 SPATIAL index; can't be combined with the other flags. More...
 
constexpr uint32_t DICT_VIRTUAL = 128
 Index on Virtual column. More...
 
constexpr uint32_t DICT_SDI = 256
 
constexpr uint32_t DICT_MULTI_VALUE = 512
 Multi-value index. More...
 
constexpr uint32_t DICT_IT_BITS = 10
 number of bits used for SYS_INDEXES.TYPE More...
 
constexpr uint32_t DICT_TF2_BITS = 11
 Table Flags set number 2. More...
 
constexpr uint32_t DICT_TF2_UNUSED_BIT_MASK = ~0U << DICT_TF2_BITS
 
constexpr uint32_t DICT_TF2_BIT_MASK = ~DICT_TF2_UNUSED_BIT_MASK
 
constexpr uint32_t DICT_TF2_TEMPORARY = 1
 TEMPORARY; true for tables from CREATE TEMPORARY TABLE. More...
 
constexpr uint32_t DICT_TF2_FTS_HAS_DOC_ID = 2
 The table has an internal defined DOC ID column. More...
 
constexpr uint32_t DICT_TF2_FTS = 4
 The table has an FTS index. More...
 
constexpr uint32_t DICT_TF2_FTS_ADD_DOC_ID = 8
 Need to add Doc ID column for FTS index build. More...
 
constexpr uint32_t DICT_TF2_USE_FILE_PER_TABLE = 16
 This bit is used during table creation to indicate that it will use its own tablespace instead of the system tablespace. More...
 
constexpr uint32_t DICT_TF2_DISCARDED = 32
 Set when we discard/detach the tablespace. More...
 
constexpr uint32_t DICT_TF2_INTRINSIC = 128
 Intrinsic table bit Intrinsic table is table created internally by MySQL modules viz. More...
 
constexpr uint32_t DICT_TF2_ENCRYPTION_FILE_PER_TABLE = 256
 Encryption table bit for innodb_file-per-table only. More...
 
constexpr uint32_t DICT_TF2_AUX = 512
 FTS AUX hidden table bit. More...
 
constexpr uint32_t DICT_TF2_RESURRECT_PREPARED = 1024
 Table is opened by resurrected trx during crash recovery. More...
 
constexpr uint32_t DICT_FOREIGN_ON_DELETE_CASCADE = 1
 The flags for ON_UPDATE and ON_DELETE can be ORed; the default is that a foreign key constraint is enforced, therefore RESTRICT just means no flag. More...
 
constexpr uint32_t DICT_FOREIGN_ON_DELETE_SET_NULL = 2
 ON DELETE SET NULL. More...
 
constexpr uint32_t DICT_FOREIGN_ON_UPDATE_CASCADE = 4
 ON UPDATE CASCADE. More...
 
constexpr uint32_t DICT_FOREIGN_ON_UPDATE_SET_NULL = 8
 ON UPDATE SET NULL. More...
 
constexpr uint32_t DICT_FOREIGN_ON_DELETE_NO_ACTION = 16
 ON DELETE NO ACTION. More...
 
constexpr uint32_t DICT_FOREIGN_ON_UPDATE_NO_ACTION = 32
 ON UPDATE NO ACTION. More...
 
constexpr uint32_t DICT_TF_REDUNDANT = 0
 dict_table_t::flags bit 0 is equal to 0 if the row format = Redundant More...
 
constexpr uint32_t DICT_TF_COMPACT = 1
 dict_table_t::flags bit 0 is equal to 1 if the row format = Compact More...
 
constexpr uint32_t DICT_N_COLS_COMPACT = 0x80000000UL
 This bitmask is used in SYS_TABLES.N_COLS to set and test whether the Compact page format is used, i.e ROW_FORMAT != REDUNDANT. More...
 
constexpr uint32_t DICT_TF_WIDTH_COMPACT = 1
 Width of the COMPACT flag. More...
 
constexpr uint32_t DICT_TF_WIDTH_ZIP_SSIZE = 4
 Width of the ZIP_SSIZE flag. More...
 
constexpr uint32_t DICT_TF_WIDTH_ATOMIC_BLOBS = 1
 Width of the ATOMIC_BLOBS flag. More...
 
constexpr uint32_t DICT_TF_WIDTH_DATA_DIR = 1
 If a table is created with the MYSQL option DATA DIRECTORY and innodb-file-per-table, an older engine will not be able to find that table. More...
 
constexpr uint32_t DICT_TF_WIDTH_SHARED_SPACE = 1
 Width of the SHARED tablespace flag. More...
 
constexpr uint32_t DICT_TF_BITS
 Width of all the currently known table flags. More...
 
constexpr uint32_t DICT_TF_BIT_MASK = ~(~0U << DICT_TF_BITS)
 A mask of all the known/used bits in table flags. More...
 
constexpr uint32_t DICT_TF_POS_COMPACT = 0
 Zero relative shift position of the COMPACT field. More...
 
constexpr uint32_t DICT_TF_POS_ZIP_SSIZE
 Zero relative shift position of the ZIP_SSIZE field. More...
 
constexpr uint32_t DICT_TF_POS_ATOMIC_BLOBS
 Zero relative shift position of the ATOMIC_BLOBS field. More...
 
constexpr uint32_t DICT_TF_POS_DATA_DIR
 Zero relative shift position of the DATA_DIR field. More...
 
constexpr uint32_t DICT_TF_POS_SHARED_SPACE
 Zero relative shift position of the SHARED TABLESPACE field. More...
 
constexpr uint32_t DICT_TF_POS_UNUSED
 Zero relative shift position of the start of the UNUSED bits. More...
 
constexpr uint32_t DICT_TF_MASK_COMPACT
 Bit mask of the COMPACT field. More...
 
constexpr uint32_t DICT_TF_MASK_ZIP_SSIZE
 Bit mask of the ZIP_SSIZE field. More...
 
constexpr uint32_t DICT_TF_MASK_ATOMIC_BLOBS
 Bit mask of the ATOMIC_BLOBS field. More...
 
constexpr uint32_t DICT_TF_MASK_DATA_DIR
 Bit mask of the DATA_DIR field. More...
 
constexpr uint32_t DICT_TF_MASK_SHARED_SPACE
 Bit mask of the SHARED_SPACE field. More...
 
uint32_t DICT_TF_GET_COMPACT (uint32_t flags)
 Return the value of the COMPACT field. More...
 
uint32_t DICT_TF_GET_ZIP_SSIZE (uint32_t flags)
 Return the value of the ZIP_SSIZE field. More...
 
uint32_t DICT_TF_HAS_ATOMIC_BLOBS (uint32_t flags)
 Return the value of the ATOMIC_BLOBS field. More...
 
uint32_t DICT_TF_HAS_DATA_DIR (uint32_t flags)
 Return the value of the DATA_DIR field. More...
 
uint32_t DICT_TF_HAS_SHARED_SPACE (uint32_t flags)
 Return the value of the SHARED_SPACE field. More...
 
uint32_t DICT_TF_GET_UNUSED (uint32_t flags)
 Return the contents of the UNUSED bits. More...
 

Detailed Description

Data dictionary memory object creation.

Created 1/8/1996 Heikki Tuuri

Macro Definition Documentation

◆ BG_STAT_IN_PROGRESS

#define BG_STAT_IN_PROGRESS   (1 << 0)

Set in 'stats_bg_flag' when the background stats code is working on this table.

The DROP TABLE code waits for this to be cleared before proceeding.

◆ BG_STAT_NONE

#define BG_STAT_NONE   0

Background stats thread is not working on this table.

◆ BG_STAT_SHOULD_QUIT

#define BG_STAT_SHOULD_QUIT   (1 << 1)

Set in 'stats_bg_flag' when DROP TABLE starts waiting on BG_STAT_IN_PROGRESS to be cleared.

The background stats thread will detect this and will eventually quit sooner.

◆ DICT_MAX_FIELD_LEN_BY_FORMAT

#define DICT_MAX_FIELD_LEN_BY_FORMAT (   table)
Value:
static bool dict_table_has_atomic_blobs(const dict_table_t *table)
Determine if a table uses atomic BLOBs (no locally stored prefix).
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
constexpr uint32_t REC_ANTELOPE_MAX_INDEX_COL_LEN
Definition: rem0types.h:66
constexpr uint32_t REC_VERSION_56_MAX_INDEX_COL_LEN
Maximum indexed field length for tables that have atomic BLOBs.
Definition: rem0types.h:71

Find out maximum indexed column length by its table format.

For ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT, the maximum field length is REC_ANTELOPE_MAX_INDEX_COL_LEN - 1 (767). For ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC, the length could be REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes

◆ DICT_STATS_AUTO_RECALC_OFF

#define DICT_STATS_AUTO_RECALC_OFF   (1 << 2)

◆ DICT_STATS_AUTO_RECALC_ON

#define DICT_STATS_AUTO_RECALC_ON   (1 << 1)

The two bits below are set in the 'stats_auto_recalc' member.

They have the following meaning:

  1. _ON=0, _OFF=0, no explicit auto recalc setting for this table, the value of the global srv_stats_persistent_auto_recalc is used to determine whether the table has auto recalc enabled or not
  2. _ON=0, _OFF=1, auto recalc is explicitly disabled for this table, regardless of the value of the global srv_stats_persistent_auto_recalc
  3. _ON=1, _OFF=0, auto recalc is explicitly enabled for this table, regardless of the value of the global srv_stats_persistent_auto_recalc
  4. _ON=1, _OFF=1, not allowed, we assert if this ever happens.

◆ DICT_STATS_PERSISTENT_OFF

#define DICT_STATS_PERSISTENT_OFF   (1 << 2)

◆ DICT_STATS_PERSISTENT_ON

#define DICT_STATS_PERSISTENT_ON   (1 << 1)

The two bits below are set in the 'stat_persistent' member.

They have the following meaning:

  1. _ON=0, _OFF=0, no explicit persistent stats setting for this table, the value of the global srv_stats_persistent is used to determine whether the table has persistent stats enabled or not
  2. _ON=0, _OFF=1, persistent stats are explicitly disabled for this table, regardless of the value of the global srv_stats_persistent
  3. _ON=1, _OFF=0, persistent stats are explicitly enabled for this table, regardless of the value of the global srv_stats_persistent
  4. _ON=1, _OFF=1, not allowed, we assert if this ever happens.

Typedef Documentation

◆ corrupted_ids_t

◆ dict_foreign_set

◆ dict_s_col_list

list to put stored column for dict_table_t

◆ dict_v_idx_list

Index list to put in dict_v_col_t.

◆ dict_vcol_set

typedef std::set<dict_v_col_t *, std::less<dict_v_col_t *>, ut::allocator<dict_v_col_t *> > dict_vcol_set

Set to store the virtual columns which are affected by Foreign key constraint.

◆ table_lock_list_t

◆ temp_prebuilt_vec

typedef std::vector<row_prebuilt_t *> temp_prebuilt_vec

A vector to collect prebuilt from different readers working on the same temp table.

Enumeration Type Documentation

◆ online_index_status

The status of online index creation.

Enumerator
ONLINE_INDEX_COMPLETE 

the index is complete and ready for access

ONLINE_INDEX_CREATION 

the index is being created, online (allowing concurrent modifications)

ONLINE_INDEX_ABORTED 

secondary index creation was aborted and the index should be dropped as soon as index->table->n_ref_count reaches 0, or online table rebuild was aborted and the clustered index of the original table should soon be restored to ONLINE_INDEX_COMPLETE

ONLINE_INDEX_ABORTED_DROPPED 

the online index creation was aborted, the index was dropped from the data dictionary and the tablespace, and it should be dropped from the data dictionary cache as soon as index->table->n_ref_count reaches 0.

◆ persistent_type_t

Persistent dynamic metadata type, there should be 1 to 1 relationship between the metadata and the type.

Please keep them in order so that we can iterate over it

Enumerator
PM_SMALLEST_TYPE 

The smallest type, which should be 1 less than the first true type.

PM_INDEX_CORRUPTED 

Persistent Metadata type for corrupted indexes.

PM_TABLE_AUTO_INC 

Persistent Metadata type for autoinc counter.

PM_BIGGEST_TYPE 

The biggest type, which should be 1 bigger than the last true type.

◆ table_dirty_status

The dirty status of tables, used to indicate if a table has some dynamic metadata changed to be written back.

Enumerator
METADATA_DIRTY 

Some persistent metadata is now dirty in memory, need to be written back to DDTableBuffer table and(or directly to) DD table.

There could be some exceptions, when it's marked as dirty, but the metadata has already been written back to DDTableBuffer. For example, if a corrupted index is found and marked as corrupted, then it gets dropped. At this time, the dirty_status is still of this dirty value. Also a concurrent checkpoint make this bit out-of-date for other working threads, which still think the status is dirty and write-back is necessary. There could be either one row or no row for this table in DDTableBuffer table

METADATA_BUFFERED 

Some persistent metadata is buffered in DDTableBuffer table, need to be written back to DD table.

There is must be one row in DDTableBuffer table for this table

METADATA_CLEAN 

All persistent metadata are up to date.

There is no row for this table in DDTableBuffer table

Function Documentation

◆ dict_foreign_free()

void dict_foreign_free ( dict_foreign_t foreign)
inline

Frees a foreign key struct.

in, own: foreign key struct

Parameters
foreignin, own: foreign key struct

◆ dict_foreign_set_validate() [1/2]

bool dict_foreign_set_validate ( const dict_foreign_set fk_set)

Validate the search order in the foreign key set.

Parameters
[in]fk_setthe foreign key set to be validated
Returns
true if search order is fine in the set, false otherwise.

◆ dict_foreign_set_validate() [2/2]

bool dict_foreign_set_validate ( const dict_table_t table)

Validate the search order in the foreign key sets of the table (foreign_set and referenced_set).

Parameters
[in]tabletable whose foreign key sets are to be validated
Returns
true if foreign key sets are fine, false otherwise.

◆ dict_index_zip_pad_mutex_create_lazy()

void dict_index_zip_pad_mutex_create_lazy ( dict_index_t index)
inline

Request a lazy creation of dict_index_t::zip_pad::mutex.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]indexindex whose zip_pad mutex is to be created

◆ dict_index_zip_pad_mutex_destroy()

void dict_index_zip_pad_mutex_destroy ( dict_index_t index)
inline

Destroy the zip_pad_mutex of the given index.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]indexindex whose stats latch to destroy

◆ dict_index_zip_pad_unlock()

void dict_index_zip_pad_unlock ( dict_index_t index)
inline

Release the zip_pad_mutex of a given index.

Parameters
[in,out]indexindex whose zip_pad_mutex is to be released

◆ DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG()

static uint32_t DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG ( uint32_t  flags)
inlinestatic

◆ dict_mem_create_temporary_tablename()

char * dict_mem_create_temporary_tablename ( mem_heap_t heap,
const char *  dbtab,
table_id_t  id 
)

Create a temporary tablename like "#sql-ibtid-inc" where tid = the Table ID inc = a randomly initialized number that is incremented for each file The table ID is a 64 bit integer, can use up to 20 digits, and is initialized at bootstrap.

The second number is 32 bits, can use up to 10 digits, and is initialized at startup to a randomly distributed number. It is hoped that the combination of these two numbers will provide a reasonably unique temporary file name.

Parameters
[in]heapA memory heap
[in]dbtabTable name in the form database/table name
[in]idTable id
Returns
A unique temporary tablename suitable for InnoDB use

◆ dict_mem_fill_index_struct()

static void dict_mem_fill_index_struct ( dict_index_t index,
mem_heap_t heap,
const char *  table_name,
const char *  index_name,
ulint  space,
ulint  type,
ulint  n_fields 
)
inlinestatic

This function poplulates a dict_index_t index memory structure with supplied information.

Parameters
[out]indexindex to be filled
[in]heapmemory heap
[in]table_nametable name
[in]index_nameindex name
[in]spacespace where the index tree is placed, the clustered type ignored if the index is of the clustered type
[in]typeDICT_UNIQUE, DICT_CLUSTERED, ... ORed
[in]n_fieldsnumber of fields

◆ dict_mem_foreign_create()

dict_foreign_t * dict_mem_foreign_create ( void  )

Creates and initializes a foreign constraint memory object.

Returns
own: foreign constraint struct

◆ dict_mem_foreign_fill_vcol_set()

void dict_mem_foreign_fill_vcol_set ( dict_foreign_t foreign)

Fills the dependent virtual columns in a set.

Reason for being dependent are 1) FK can be present on base column of virtual columns 2) FK can be present on column which is a part of virtual index

Parameters
[in,out]foreignforeign key information.

FK can be present on base columns of virtual columns.

FK can be present on the columns which can be a part of virtual index.

◆ dict_mem_foreign_table_name_lookup_set()

void dict_mem_foreign_table_name_lookup_set ( dict_foreign_t foreign,
bool  do_alloc 
)

Sets the foreign_table_name_lookup pointer based on the value of lower_case_table_names.

If that is 0 or 1, foreign_table_name_lookup will point to foreign_table_name. If 2, then another string is allocated from the heap and set to lower case. in: is an alloc needed

If that is 0 or 1, foreign_table_name_lookup will point to foreign_table_name. If 2, then another string is allocated from foreign->heap and set to lower case.

Parameters
foreignin/out: foreign struct
do_allocin: is an alloc needed

◆ dict_mem_index_free()

void dict_mem_index_free ( dict_index_t index)

Frees an index memory object.

in: index

Parameters
indexin: index

◆ dict_mem_init()

void dict_mem_init ( void  )

Initialize dict memory variables.

◆ dict_mem_referenced_table_name_lookup_set()

void dict_mem_referenced_table_name_lookup_set ( dict_foreign_t foreign,
bool  do_alloc 
)

Sets the referenced_table_name_lookup pointer based on the value of lower_case_table_names.

If that is 0 or 1, referenced_table_name_lookup will point to referenced_table_name. If 2, then another string is allocated from the heap and set to lower case. in: is an alloc needed

If that is 0 or 1, referenced_table_name_lookup will point to referenced_table_name. If 2, then another string is allocated from foreign->heap and set to lower case.

Parameters
foreignin/out: foreign struct
do_allocin: is an alloc needed

◆ dict_mem_table_add_s_col()

void dict_mem_table_add_s_col ( dict_table_t table,
ulint  num_base 
)

Adds a stored column definition to a table.

Parameters
[in,out]tabletable
[in]num_basenumber of base columns.

◆ dict_mem_table_add_v_col()

dict_v_col_t * dict_mem_table_add_v_col ( dict_table_t table,
mem_heap_t heap,
const char *  name,
ulint  mtype,
ulint  prtype,
ulint  len,
ulint  pos,
ulint  num_base,
bool  is_visible 
)

Adds a virtual column definition to a table.

Parameters
[in,out]tabletable
[in]heaptemporary memory heap, or NULL. It is used to store name when we have not finished adding all columns. When all columns are added, the whole name will copy to memory from table->heap
[in]namecolumn name
[in]mtypemain datatype
[in]prtypeprecise type
[in]lenlength
[in]posposition in a table
[in]num_basenumber of base columns
[in]is_visibleTrue if virtual column is visible to user
Returns
the virtual column definition

◆ dict_mem_table_col_rename()

void dict_mem_table_col_rename ( dict_table_t table,
ulint  nth_col,
const char *  from,
const char *  to,
bool  is_virtual 
)

Renames a column of a table in the data dictionary cache.

Parameters
[in,out]tableTable
[in]nth_colColumn index
[in]fromOld column name
[in]toNew column name
[in]is_virtualIf this is a virtual column

◆ dict_mem_table_fill_foreign_vcol_set()

void dict_mem_table_fill_foreign_vcol_set ( dict_table_t table)

Fill virtual columns set in each fk constraint present in the table.

Parameters
[in,out]tableinnodb table object.

◆ dict_mem_table_free_foreign_vcol_set()

void dict_mem_table_free_foreign_vcol_set ( dict_table_t table)

Free the vcol_set from all foreign key constraint on the table.

Parameters
[in,out]tableinnodb table object.

◆ dict_table_autoinc_create_lazy()

void dict_table_autoinc_create_lazy ( dict_table_t table)
inline

Request for lazy creation of the autoinc latch of a given table.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]tabletable whose autoinc latch is to be created.

◆ dict_table_autoinc_destroy()

void dict_table_autoinc_destroy ( dict_table_t table)
inline

Destroy the autoinc latch of the given table.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]tabletable whose stats latch to destroy

◆ dict_table_autoinc_own()

bool dict_table_autoinc_own ( const dict_table_t table)
inline

Check if the current thread owns the autoinc_mutex of a given table.

Parameters
[in]tablethe autoinc_mutex belongs to this table
Returns
true, if the current thread owns the autoinc_mutex, false otherwise.

◆ dict_table_mutex_create_lazy()

void dict_table_mutex_create_lazy ( dict_table_t table)
inline

Request for lazy creation of the mutex of a given table.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]tabletable whose mutex is to be created

◆ dict_table_mutex_destroy()

void dict_table_mutex_destroy ( dict_table_t table)
inline

Destroy the mutex of a given table.

This function is only called from either single threaded environment or from a thread that has not shared the table object with other threads.

Parameters
[in,out]tabletable whose mutex is to be created

◆ DICT_TF2_FLAG_IS_SET()

static bool DICT_TF2_FLAG_IS_SET ( const dict_table_t table,
uint32_t  flag 
)
inlinestatic

◆ DICT_TF2_FLAG_SET()

static void DICT_TF2_FLAG_SET ( dict_table_t table,
uint32_t  flag 
)
inlinestatic

◆ DICT_TF2_FLAG_UNSET()

static void DICT_TF2_FLAG_UNSET ( dict_table_t table,
uint32_t  flag 
)
inlinestatic

◆ DICT_TF_GET_COMPACT()

uint32_t DICT_TF_GET_COMPACT ( uint32_t  flags)
inline

Return the value of the COMPACT field.

◆ DICT_TF_GET_UNUSED()

uint32_t DICT_TF_GET_UNUSED ( uint32_t  flags)
inline

Return the contents of the UNUSED bits.

◆ DICT_TF_GET_ZIP_SSIZE()

uint32_t DICT_TF_GET_ZIP_SSIZE ( uint32_t  flags)
inline

Return the value of the ZIP_SSIZE field.

◆ DICT_TF_HAS_ATOMIC_BLOBS()

uint32_t DICT_TF_HAS_ATOMIC_BLOBS ( uint32_t  flags)
inline

Return the value of the ATOMIC_BLOBS field.

◆ DICT_TF_HAS_DATA_DIR()

uint32_t DICT_TF_HAS_DATA_DIR ( uint32_t  flags)
inline

Return the value of the DATA_DIR field.

◆ DICT_TF_HAS_SHARED_SPACE()

uint32_t DICT_TF_HAS_SHARED_SPACE ( uint32_t  flags)
inline

Return the value of the SHARED_SPACE field.

◆ is_valid_row_version()

static bool is_valid_row_version ( const uint8_t  version)
inlinestatic

◆ operator<<() [1/4]

std::ostream & operator<< ( std::ostream &  out,
const dict_foreign_set fk_set 
)

◆ operator<<() [2/4]

std::ostream & operator<< ( std::ostream &  out,
const dict_foreign_t foreign 
)

◆ operator<<() [3/4]

std::ostream & operator<< ( std::ostream &  s,
const id_name_t id_name 
)

Display an identifier.

Parameters
[in,out]soutput stream
[in]id_nameSQL identifier (other than table name)
Returns
the output stream

◆ operator<<() [4/4]

std::ostream & operator<< ( std::ostream &  s,
const table_name_t table_name 
)

Display a table name.

Parameters
[in,out]soutput stream
[in]table_nametable name
Returns
the output stream

Variable Documentation

◆ DICT_ANTELOPE_MAX_INDEX_COL_LEN

constexpr uint32_t DICT_ANTELOPE_MAX_INDEX_COL_LEN
constexpr
Initial value:

DICT_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and is the maximum indexed column length (or indexed prefix length) in ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT.

Also, in any format, any fixed-length field that is longer than this will be encoded as a variable-length field.

It is set to 3*256, so that one can create a column prefix index on 256 characters of a TEXT or VARCHAR column also in the UTF-8 charset. In that charset, a character may take at most 3 bytes. This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data files would be at risk!

◆ DICT_CLUSTERED

constexpr uint32_t DICT_CLUSTERED = 1
constexpr

Type flags of an index: OR'ing of the flags is allowed to define a combination of types.

clustered index; for other than auto-generated clustered indexes, also DICT_UNIQUE will be set

◆ DICT_CORRUPT

constexpr uint32_t DICT_CORRUPT = 16
constexpr

bit to store the corrupted flag in SYS_INDEXES.TYPE

◆ DICT_FK_MAX_RECURSIVE_LOAD

constexpr uint32_t DICT_FK_MAX_RECURSIVE_LOAD = 20
constexpr

Tables could be chained together with Foreign key constraint.

When first load the parent table, we would load all of its descedents. This could result in rescursive calls and out of stack error eventually. DICT_FK_MAX_RECURSIVE_LOAD defines the maximum number of recursive loads, when exceeded, the child table will not be loaded. It will be loaded when the foreign constraint check needs to be run.

◆ DICT_FOREIGN_ON_DELETE_CASCADE

constexpr uint32_t DICT_FOREIGN_ON_DELETE_CASCADE = 1
constexpr

The flags for ON_UPDATE and ON_DELETE can be ORed; the default is that a foreign key constraint is enforced, therefore RESTRICT just means no flag.

ON DELETE CASCADE

◆ DICT_FOREIGN_ON_DELETE_NO_ACTION

constexpr uint32_t DICT_FOREIGN_ON_DELETE_NO_ACTION = 16
constexpr

ON DELETE NO ACTION.

◆ DICT_FOREIGN_ON_DELETE_SET_NULL

constexpr uint32_t DICT_FOREIGN_ON_DELETE_SET_NULL = 2
constexpr

ON DELETE SET NULL.

◆ DICT_FOREIGN_ON_UPDATE_CASCADE

constexpr uint32_t DICT_FOREIGN_ON_UPDATE_CASCADE = 4
constexpr

ON UPDATE CASCADE.

◆ DICT_FOREIGN_ON_UPDATE_NO_ACTION

constexpr uint32_t DICT_FOREIGN_ON_UPDATE_NO_ACTION = 32
constexpr

ON UPDATE NO ACTION.

◆ DICT_FOREIGN_ON_UPDATE_SET_NULL

constexpr uint32_t DICT_FOREIGN_ON_UPDATE_SET_NULL = 8
constexpr

ON UPDATE SET NULL.

◆ DICT_FTS

constexpr uint32_t DICT_FTS = 32
constexpr

FTS index; can't be combined with the other flags.

◆ DICT_IBUF

constexpr uint32_t DICT_IBUF = 8
constexpr

insert buffer tree

◆ DICT_INDEX_MAGIC_N

constexpr uint32_t DICT_INDEX_MAGIC_N = 76789786
constexpr

Value of dict_index_t::magic_n.

◆ DICT_INDEX_MERGE_THRESHOLD_DEFAULT

constexpr uint32_t DICT_INDEX_MERGE_THRESHOLD_DEFAULT = 50
constexpr

◆ DICT_IT_BITS

constexpr uint32_t DICT_IT_BITS = 10
constexpr

number of bits used for SYS_INDEXES.TYPE

◆ DICT_MAX_FIXED_COL_LEN

constexpr uint32_t DICT_MAX_FIXED_COL_LEN = DICT_ANTELOPE_MAX_INDEX_COL_LEN
constexpr

Defines the maximum fixed length column size.

◆ DICT_MULTI_VALUE

constexpr uint32_t DICT_MULTI_VALUE = 512
constexpr

Multi-value index.

◆ DICT_N_COLS_COMPACT

constexpr uint32_t DICT_N_COLS_COMPACT = 0x80000000UL
constexpr

This bitmask is used in SYS_TABLES.N_COLS to set and test whether the Compact page format is used, i.e ROW_FORMAT != REDUNDANT.

◆ DICT_SDI

constexpr uint32_t DICT_SDI = 256
constexpr

◆ DICT_SPATIAL

constexpr uint32_t DICT_SPATIAL = 64
constexpr

SPATIAL index; can't be combined with the other flags.

◆ DICT_TABLE_MAGIC_N

constexpr uint32_t DICT_TABLE_MAGIC_N = 76333786
constexpr

Value of 'magic_n'.

◆ DICT_TF2_AUX

constexpr uint32_t DICT_TF2_AUX = 512
constexpr

FTS AUX hidden table bit.

◆ DICT_TF2_BIT_MASK

constexpr uint32_t DICT_TF2_BIT_MASK = ~DICT_TF2_UNUSED_BIT_MASK
constexpr

◆ DICT_TF2_BITS

constexpr uint32_t DICT_TF2_BITS = 11
constexpr

Table Flags set number 2.

These flags will be stored in SYS_TABLES.MIX_LEN. All unused flags will be written as 0. The column may contain garbage for tables created with old versions of InnoDB that only implemented ROW_FORMAT=REDUNDANT. InnoDB engines do not check these flags for unknown bits in order to protect backward incompatibility. Total number of bits in table->flags2.

◆ DICT_TF2_DISCARDED

constexpr uint32_t DICT_TF2_DISCARDED = 32
constexpr

Set when we discard/detach the tablespace.

◆ DICT_TF2_ENCRYPTION_FILE_PER_TABLE

constexpr uint32_t DICT_TF2_ENCRYPTION_FILE_PER_TABLE = 256
constexpr

Encryption table bit for innodb_file-per-table only.

◆ DICT_TF2_FTS

constexpr uint32_t DICT_TF2_FTS = 4
constexpr

The table has an FTS index.

◆ DICT_TF2_FTS_ADD_DOC_ID

constexpr uint32_t DICT_TF2_FTS_ADD_DOC_ID = 8
constexpr

Need to add Doc ID column for FTS index build.

This is a transient bit for index build

◆ DICT_TF2_FTS_HAS_DOC_ID

constexpr uint32_t DICT_TF2_FTS_HAS_DOC_ID = 2
constexpr

The table has an internal defined DOC ID column.

◆ DICT_TF2_INTRINSIC

constexpr uint32_t DICT_TF2_INTRINSIC = 128
constexpr

Intrinsic table bit Intrinsic table is table created internally by MySQL modules viz.

Optimizer, FTS, etc.... Intrinsic table has all the properties of the normal table except it is not created by user and so not visible to end-user.

◆ DICT_TF2_RESURRECT_PREPARED

constexpr uint32_t DICT_TF2_RESURRECT_PREPARED = 1024
constexpr

Table is opened by resurrected trx during crash recovery.

◆ DICT_TF2_TEMPORARY

constexpr uint32_t DICT_TF2_TEMPORARY = 1
constexpr

TEMPORARY; true for tables from CREATE TEMPORARY TABLE.

◆ DICT_TF2_UNUSED_BIT_MASK

constexpr uint32_t DICT_TF2_UNUSED_BIT_MASK = ~0U << DICT_TF2_BITS
constexpr

◆ DICT_TF2_USE_FILE_PER_TABLE

constexpr uint32_t DICT_TF2_USE_FILE_PER_TABLE = 16
constexpr

This bit is used during table creation to indicate that it will use its own tablespace instead of the system tablespace.

◆ DICT_TF_BIT_MASK

constexpr uint32_t DICT_TF_BIT_MASK = ~(~0U << DICT_TF_BITS)
constexpr

A mask of all the known/used bits in table flags.

◆ DICT_TF_BITS

constexpr uint32_t DICT_TF_BITS
constexpr
Initial value:
=
constexpr uint32_t DICT_TF_WIDTH_SHARED_SPACE
Width of the SHARED tablespace flag.
Definition: dict0mem.h:183
constexpr uint32_t DICT_TF_WIDTH_DATA_DIR
If a table is created with the MYSQL option DATA DIRECTORY and innodb-file-per-table,...
Definition: dict0mem.h:175
constexpr uint32_t DICT_TF_WIDTH_COMPACT
Width of the COMPACT flag.
Definition: dict0mem.h:158
constexpr uint32_t DICT_TF_WIDTH_ZIP_SSIZE
Width of the ZIP_SSIZE flag.
Definition: dict0mem.h:161
constexpr uint32_t DICT_TF_WIDTH_ATOMIC_BLOBS
Width of the ATOMIC_BLOBS flag.
Definition: dict0mem.h:169

Width of all the currently known table flags.

◆ DICT_TF_COMPACT

constexpr uint32_t DICT_TF_COMPACT = 1
constexpr

dict_table_t::flags bit 0 is equal to 1 if the row format = Compact

Compact row format.

◆ DICT_TF_MASK_ATOMIC_BLOBS

constexpr uint32_t DICT_TF_MASK_ATOMIC_BLOBS
constexpr
Initial value:
=
constexpr uint32_t DICT_TF_POS_ATOMIC_BLOBS
Zero relative shift position of the ATOMIC_BLOBS field.
Definition: dict0mem.h:200
Definition: dtoa.cc:588

Bit mask of the ATOMIC_BLOBS field.

◆ DICT_TF_MASK_COMPACT

constexpr uint32_t DICT_TF_MASK_COMPACT
constexpr
Initial value:
constexpr uint32_t DICT_TF_POS_COMPACT
Zero relative shift position of the COMPACT field.
Definition: dict0mem.h:195

Bit mask of the COMPACT field.

◆ DICT_TF_MASK_DATA_DIR

constexpr uint32_t DICT_TF_MASK_DATA_DIR
constexpr
Initial value:
constexpr uint32_t DICT_TF_POS_DATA_DIR
Zero relative shift position of the DATA_DIR field.
Definition: dict0mem.h:203

Bit mask of the DATA_DIR field.

◆ DICT_TF_MASK_SHARED_SPACE

constexpr uint32_t DICT_TF_MASK_SHARED_SPACE
constexpr
Initial value:
=
constexpr uint32_t DICT_TF_POS_SHARED_SPACE
Zero relative shift position of the SHARED TABLESPACE field.
Definition: dict0mem.h:206

Bit mask of the SHARED_SPACE field.

◆ DICT_TF_MASK_ZIP_SSIZE

constexpr uint32_t DICT_TF_MASK_ZIP_SSIZE
constexpr
Initial value:
constexpr uint32_t DICT_TF_POS_ZIP_SSIZE
Zero relative shift position of the ZIP_SSIZE field.
Definition: dict0mem.h:197

Bit mask of the ZIP_SSIZE field.

◆ DICT_TF_POS_ATOMIC_BLOBS

constexpr uint32_t DICT_TF_POS_ATOMIC_BLOBS
constexpr
Initial value:

Zero relative shift position of the ATOMIC_BLOBS field.

◆ DICT_TF_POS_COMPACT

constexpr uint32_t DICT_TF_POS_COMPACT = 0
constexpr

Zero relative shift position of the COMPACT field.

◆ DICT_TF_POS_DATA_DIR

constexpr uint32_t DICT_TF_POS_DATA_DIR
constexpr
Initial value:

Zero relative shift position of the DATA_DIR field.

◆ DICT_TF_POS_SHARED_SPACE

constexpr uint32_t DICT_TF_POS_SHARED_SPACE
constexpr
Initial value:

Zero relative shift position of the SHARED TABLESPACE field.

◆ DICT_TF_POS_UNUSED

constexpr uint32_t DICT_TF_POS_UNUSED
constexpr
Initial value:

Zero relative shift position of the start of the UNUSED bits.

◆ DICT_TF_POS_ZIP_SSIZE

constexpr uint32_t DICT_TF_POS_ZIP_SSIZE
constexpr
Initial value:

Zero relative shift position of the ZIP_SSIZE field.

◆ DICT_TF_REDUNDANT

constexpr uint32_t DICT_TF_REDUNDANT = 0
constexpr

dict_table_t::flags bit 0 is equal to 0 if the row format = Redundant

Redundant row format.

◆ DICT_TF_WIDTH_ATOMIC_BLOBS

constexpr uint32_t DICT_TF_WIDTH_ATOMIC_BLOBS = 1
constexpr

Width of the ATOMIC_BLOBS flag.

The ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT broke up BLOB and TEXT fields, storing the first 768 bytes in the clustered index. ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED store the whole blob or text field off-page atomically. Secondary indexes are created from this external data using row_ext_t to cache the BLOB prefixes.

◆ DICT_TF_WIDTH_COMPACT

constexpr uint32_t DICT_TF_WIDTH_COMPACT = 1
constexpr

Width of the COMPACT flag.

◆ DICT_TF_WIDTH_DATA_DIR

constexpr uint32_t DICT_TF_WIDTH_DATA_DIR = 1
constexpr

If a table is created with the MYSQL option DATA DIRECTORY and innodb-file-per-table, an older engine will not be able to find that table.

This flag prevents older engines from attempting to open the table and allows InnoDB to update_create_info() accordingly.

◆ DICT_TF_WIDTH_SHARED_SPACE

constexpr uint32_t DICT_TF_WIDTH_SHARED_SPACE = 1
constexpr

Width of the SHARED tablespace flag.

It is used to identify tables that exist inside a shared general tablespace. If a table is created with the TABLESPACE=tsname option, an older engine will not be able to find that table. This flag prevents older engines from attempting to open the table and allows InnoDB to quickly find the tablespace.

◆ DICT_TF_WIDTH_ZIP_SSIZE

constexpr uint32_t DICT_TF_WIDTH_ZIP_SSIZE = 4
constexpr

Width of the ZIP_SSIZE flag.

◆ DICT_UNIQUE

constexpr uint32_t DICT_UNIQUE = 2
constexpr

unique index

◆ DICT_VIRTUAL

constexpr uint32_t DICT_VIRTUAL = 128
constexpr

Index on Virtual column.

◆ FK_MAX_CASCADE_DEL

constexpr uint32_t FK_MAX_CASCADE_DEL = 15
constexpr

Similarly, when tables are chained together with foreign key constraints with on cascading delete/update clause, delete from parent table could result in recursive cascading calls.

This defines the maximum number of such cascading deletes/updates allowed. When exceeded, the delete from parent table will fail, and user has to drop excessive foreign constraint before proceeds.

◆ innobase_index_reserve_name

const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX"

"GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key.

◆ INSTANT_DROP_PREFIX_8_0_32

constexpr char INSTANT_DROP_PREFIX_8_0_32[] = "!hidden!_dropped_"
constexpr

◆ INSTANT_DROP_SUFFIX_8_0_29

constexpr char INSTANT_DROP_SUFFIX_8_0_29[] = "_dropped_v"
constexpr

Format of INSTANTLY DROPPED column names.

◆ MAX_KEY_LENGTH_BITS

constexpr uint32_t MAX_KEY_LENGTH_BITS = 12
constexpr

◆ MAX_ROW_VERSION

const uint8_t MAX_ROW_VERSION = 64

Maximum number of rows version allowed when columns are added/dropped INSTANTly.

After this limit is reached, any attempt to do ADD/DROP INSTANT column will result in error.

◆ RECOVERY_INDEX_TABLE_NAME

constexpr char RECOVERY_INDEX_TABLE_NAME[] = "LOG_DUMMY"
constexpr

index/table name used while applying REDO logs during recovery

◆ zip_failure_threshold_pct

ulong zip_failure_threshold_pct
extern

Percentage of compression failures that are allowed in a single round.

◆ ZIP_PAD_INCR

constexpr uint32_t ZIP_PAD_INCR = 128
constexpr

Amount by which padding is increased.

◆ zip_pad_max

ulong zip_pad_max
extern

Maximum percentage of a page that can be allowed as a pad to avoid compression failures.

◆ ZIP_PAD_ROUND_LEN

constexpr uint32_t ZIP_PAD_ROUND_LEN = 128
constexpr

PADDING HEURISTIC BASED ON LINEAR INCREASE OF PADDING TO AVOID COMPRESSION FAILURES (Note: this is relevant only for compressed indexes) GOAL: Avoid compression failures by maintaining information about the compressibility of data.

If data is not very compressible then leave some extra space 'padding' in the uncompressed page making it more likely that compression of less than fully packed uncompressed page will succeed.

This padding heuristic works by increasing the pad linearly until the desired failure rate is reached. A "round" is a fixed number of compression operations. After each round, the compression failure rate for that round is computed. If the failure rate is too high, then padding is incremented by a fixed value, otherwise it's left intact. If the compression failure is lower than the desired rate for a fixed number of consecutive rounds, then the padding is decreased by a fixed value. This is done to prevent overshooting the padding value, and to accommodate the possible change in data compressibility. Number of zip ops in one round.

◆ ZIP_PAD_SUCCESSFUL_ROUND_LIMIT

constexpr uint32_t ZIP_PAD_SUCCESSFUL_ROUND_LIMIT = 5
constexpr

Number of successful rounds after which the padding is decreased.