/**************************************************//**
@file include/dict0load.h
Loads to the memory cache database object definitions
from dictionary tables
Created 4/24/1996 Heikki Tuuri
*******************************************************/
/** A stack of table names related through foreign key constraints */ typedef std::deque<constchar*, ut_allocator<constchar*> > dict_names_t;
/** Check MAX(SPACE) FROM SYS_TABLES and store it in fil_system. Openeachdatafileifanencryptionpluginhasbeenloaded.
@paramspacessetoftablespacefilestoopen
@param upgrade whether we need to invoke ibuf_upgrade() */ void dict_load_tablespaces(const std::set<uint32_t> *spaces= nullptr, bool upgrade= false);
/** Make sure the data_file_name is saved in dict_table_t if needed.
@param[in,out] table Table object */ void dict_get_and_save_data_dir_path(dict_table_t* table);
/***********************************************************************//**
Loads a table object based on the table id.
@return table; NULL if table does not exist */
dict_table_t*
dict_load_table_on_id( /*==================*/
table_id_t table_id, /*!< in: table id */
dict_err_ignore_t ignore_err); /*!< in: errors to ignore
when loading the table */ /** Load definitions for table indexes. Adds them to the data dictionary cache. @parammtrmini-transaction @paramtabletabledefinition @paramuncommittedfalse=READCOMMITTED,true=READUNCOMMITTED @paramheapmemoryheapfortemporarystorage @paramignore_errerrorstobeignoredwhenloadingtheindexdefinition @returnerrorcode @retvalDB_SUCCESSifallindexesweresuccessfullyloaded @retvalDB_CORRUPTIONifcorruptionofdictionarytable
@retval DB_UNSUPPORTED if table has unknown index type */
MY_ATTRIBUTE((nonnull))
dberr_t dict_load_indexes(mtr_t *mtr, dict_table_t *table, bool uncommitted,
mem_heap_t *heap, dict_err_ignore_t ignore_err); /***********************************************************************//**
Loads foreign key constraints where the table is either the foreign key
holder or where the table is referenced by a foreign key. Adds these
constraints to the data dictionary.
The foreign key constraint is loaded only if the referenced table is also
in the dictionary cache. If the referenced table is not in dictionary
cache, then it is added to the output parameter (fk_tables).
@return DB_SUCCESS or error code */
dberr_t
dict_load_foreigns( /*===============*/
mtr_t& mtr, /*!< in/out: mini-transaction*/ constchar* table_name, /*!< in: table name */ constchar** col_names, /*!< in: column names, or NULL
to use table->col_names */
trx_id_t trx_id, /*!< in: DDL transaction id, or0tocheck recursiveloadoftables
chained by FK */ bool check_charsets, /*!< in: whether to check
charset compatibility */
dict_err_ignore_t ignore_err, /*!< in: error to be ignored */
dict_names_t& fk_tables) /*!< out: stack of table names whichmustbeloaded subsequentlytoloadallthe
foreign key constraints. */
MY_ATTRIBUTE((nonnull(2)));
/********************************************************************//** This function opens a system table, andreturn the first record.
@return first record of the system table */ const rec_t*
dict_startscan_system( /*==================*/
btr_pcur_t* pcur, /*!< out: persistent cursor to
the record */
mtr_t* mtr, /*!< in: the mini-transaction */
dict_table_t* table); /*!< in: system table */ /********************************************************************//** This function get the next system table record as we scan the table.
@return the record if found, NULL if end of scan. */ const rec_t*
dict_getnext_system( /*================*/
btr_pcur_t* pcur, /*!< in/out: persistent cursor
to the record */
mtr_t* mtr); /*!< in: the mini-transaction */
/** Load a table definition from a SYS_TABLES record to dict_table_t. Donotloadanycolumnsorindexes. @param[in,out]mtrmini-transaction @param[in]uncommittedwhethertouseREADUNCOMMITTEDisolationlevel @param[in]recSYS_TABLESrecord @param[out,own]tabletable,ornullptr @returnerrormessage
@retval nullptr on success */ constchar *dict_load_table_low(mtr_t *mtr, bool uncommitted, const rec_t *rec, dict_table_t **table)
MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//** This function parses a SYS_INDEXES record and populate a dict_index_t
structure with the information from the record. For detail information
about SYS_INDEXES fields, please refer to dict_boot() function.
@return error message, or NULL on success */ constchar*
dict_process_sys_indexes_rec( /*=========================*/
mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_INDEXES rec */
dict_index_t* index, /*!< out: dict_index_t to be
filled */
table_id_t* table_id); /*!< out: table id */ /********************************************************************//** This function parses a SYS_COLUMNS record and populate a dict_column_t
structure with the information from the record.
@return error message, or NULL on success */ constchar*
dict_process_sys_columns_rec( /*=========================*/
mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_COLUMNS rec */
dict_col_t* column, /*!< out: dict_col_t to be filled */
table_id_t* table_id, /*!< out: table id */ constchar** col_name, /*!< out: column name */
ulint* nth_v_col); /*!< out: if virtual col, this is
records its sequence number */
/** This function parses a SYS_VIRTUAL record and extract virtual column information @param[in,out]heapheapmemory @param[in]reccurrentSYS_COLUMNSrec @param[in,out]table_idtableid @param[in,out]posvirtualcolumnposition @param[in,out]base_posbasecolumnposition
@return error message, or NULL on success */ constchar*
dict_process_sys_virtual_rec( const rec_t* rec,
table_id_t* table_id,
ulint* pos,
ulint* base_pos); /********************************************************************//** This function parses a SYS_FIELDS record and populate a dict_field_t
structure with the information from the record.
@return error message, or NULL on success */ constchar*
dict_process_sys_fields_rec( /*========================*/
mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FIELDS rec */
dict_field_t* sys_field, /*!< out: dict_field_t to be
filled */
ulint* pos, /*!< out: Field position */
index_id_t* index_id, /*!< out: current index id */
index_id_t last_id); /*!< in: previous index id */ /********************************************************************//** This function parses a SYS_FOREIGN record and populate a dict_foreign_t
structure with the information from the record. For detail information
about SYS_FOREIGN fields, please refer to dict_load_foreign() function
@return error message, or NULL on success */ constchar*
dict_process_sys_foreign_rec( /*=========================*/
mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FOREIGN rec */
dict_foreign_t* foreign); /*!< out: dict_foreign_t to be
filled */ /********************************************************************//** This function parses a SYS_FOREIGN_COLS record and extract necessary
information from the record andreturn to caller.
@return error message, or NULL on success */ constchar*
dict_process_sys_foreign_col_rec( /*=============================*/
mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FOREIGN_COLS rec */ constchar** name, /*!< out: foreign key constraint name */ constchar** for_col_name, /*!< out: referencing column name */ constchar** ref_col_name, /*!< out: referenced column name
in referenced table */
ulint* pos); /*!< out: column position */
/** This function gets the next system table record as it scans thetable. @parampcurpersistentcursor @parammtrmini-transaction @returnthenextrecordiffound
@retval nullptr at the end of the table */ const rec_t*
dict_getnext_system_low(btr_pcur_t *pcur, mtr_t *mtr); #endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.