📄 dict0dict.h
字号:
UNIV_INLINEdict_index_t*dict_table_get_index(/*=================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ const char* name); /* in: index name *//**************************************************************************Returns an index object. */dict_index_t*dict_table_get_index_noninline(/*===========================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ const char* name); /* in: index name *//**************************************************************************Prints a table definition. */voiddict_table_print(/*=============*/ dict_table_t* table); /* in: table *//**************************************************************************Prints a table data. */voiddict_table_print_low(/*=================*/ dict_table_t* table); /* in: table *//**************************************************************************Prints a table data when we know the table name. */voiddict_table_print_by_name(/*=====================*/ const char* name);/**************************************************************************Outputs info on foreign keys of a table. */voiddict_print_info_on_foreign_keys(/*============================*/ ibool create_table_format, /* in: if TRUE then print in a format suitable to be inserted into a CREATE TABLE, otherwise in the format of SHOW TABLE STATUS */ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_table_t* table); /* in: table *//**************************************************************************Outputs info on a foreign key of a table in a format suitable forCREATE TABLE. */voiddict_print_info_on_foreign_key_in_create_format(/*============================================*/ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_foreign_t* foreign, /* in: foreign key constraint */ ibool add_newline); /* in: whether to add a newline *//************************************************************************Displays the names of the index and the table. */voiddict_index_name_print(/*==================*/ FILE* file, /* in: output stream */ trx_t* trx, /* in: transaction */ const dict_index_t* index); /* in: index to print *//************************************************************************Gets the first index on the table (the clustered index). */UNIV_INLINEdict_index_t*dict_table_get_first_index(/*=======================*/ /* out: index, NULL if none exists */ dict_table_t* table); /* in: table *//************************************************************************Gets the first index on the table (the clustered index). */dict_index_t*dict_table_get_first_index_noninline(/*=================================*/ /* out: index, NULL if none exists */ dict_table_t* table); /* in: table *//************************************************************************Gets the next index on the table. */UNIV_INLINEdict_index_t*dict_table_get_next_index(/*======================*/ /* out: index, NULL if none left */ dict_index_t* index); /* in: index *//************************************************************************Gets the next index on the table. */dict_index_t*dict_table_get_next_index_noninline(/*================================*/ /* out: index, NULL if none left */ dict_index_t* index); /* in: index *//************************************************************************Gets the number of user-defined columns in a table in the dictionarycache. */UNIV_INLINEulintdict_table_get_n_user_cols(/*=======================*/ /* out: number of user-defined (e.g., not ROW_ID) columns of a table */ dict_table_t* table); /* in: table *//************************************************************************Gets the number of system columns in a table in the dictionary cache. */UNIV_INLINEulintdict_table_get_n_sys_cols(/*======================*/ /* out: number of system (e.g., ROW_ID) columns of a table */ dict_table_t* table); /* in: table *//************************************************************************Gets the number of all columns (also system) in a table in the dictionarycache. */UNIV_INLINEulintdict_table_get_n_cols(/*==================*/ /* out: number of columns of a table */ dict_table_t* table); /* in: table *//************************************************************************Gets the nth column of a table. */UNIV_INLINEdict_col_t*dict_table_get_nth_col(/*===================*/ /* out: pointer to column object */ dict_table_t* table, /* in: table */ ulint pos); /* in: position of column *//************************************************************************Gets the nth column of a table. */dict_col_t*dict_table_get_nth_col_noninline(/*=============================*/ /* out: pointer to column object */ dict_table_t* table, /* in: table */ ulint pos); /* in: position of column *//************************************************************************Gets the given system column of a table. */UNIV_INLINEdict_col_t*dict_table_get_sys_col(/*===================*/ /* out: pointer to column object */ dict_table_t* table, /* in: table */ ulint sys); /* in: DATA_ROW_ID, ... *//************************************************************************Gets the given system column number of a table. */UNIV_INLINEulintdict_table_get_sys_col_no(/*======================*/ /* out: column number */ dict_table_t* table, /* in: table */ ulint sys); /* in: DATA_ROW_ID, ... *//************************************************************************Checks if a column is in the ordering columns of the clustered index of atable. Column prefixes are treated like whole columns. */ibooldict_table_col_in_clustered_key(/*============================*/ /* out: TRUE if the column, or its prefix, is in the clustered key */ dict_table_t* table, /* in: table */ ulint n); /* in: column number *//***********************************************************************Copies types of columns contained in table to tuple. */voiddict_table_copy_types(/*==================*/ dtuple_t* tuple, /* in: data tuple */ dict_table_t* table); /* in: index *//**************************************************************************Looks for an index with the given id. NOTE that we do not reservethe dictionary mutex: this function is for emergency purposes likeprinting info of a corrupt database page! */dict_index_t*dict_index_find_on_id_low(/*======================*/ /* out: index or NULL if not found from cache */ dulint id); /* in: index id *//**************************************************************************Adds an index to dictionary cache. */ibooldict_index_add_to_cache(/*====================*/ /* out: TRUE if success */ dict_table_t* table, /* in: table on which the index is */ dict_index_t* index, /* in, own: index; NOTE! The index memory object is freed in this function! */ ulint page_no);/* in: root page number of the index *//************************************************************************Gets the number of fields in the internal representation of an index,including fields added by the dictionary system. */UNIV_INLINEulintdict_index_get_n_fields(/*====================*/ /* out: number of fields */ dict_index_t* index); /* in: an internal representation of index (in the dictionary cache) *//************************************************************************Gets the number of fields in the internal representation of an indexthat uniquely determine the position of an index entry in the index, ifwe do not take multiversioning into account: in the B-tree use the valuereturned by dict_index_get_n_unique_in_tree. */UNIV_INLINEulintdict_index_get_n_unique(/*====================*/ /* out: number of fields */ dict_index_t* index); /* in: an internal representation of index (in the dictionary cache) *//************************************************************************Gets the number of fields in the internal representation of an indexwhich uniquely determine the position of an index entry in the index, ifwe also take multiversioning into account. */UNIV_INLINEulintdict_index_get_n_unique_in_tree(/*============================*/ /* out: number of fields */ dict_index_t* index); /* in: an internal representation of index (in the dictionary cache) *//************************************************************************Gets the number of user-defined ordering fields in the index. In the internalrepresentation we add the row id to the ordering fields to make all indexesunique, but this function returns the number of fields the user definedin the index as ordering fields. */UNIV_INLINEulintdict_index_get_n_ordering_defined_by_user(/*======================================*/ /* out: number of fields */ dict_index_t* index); /* in: an internal representation of index (in the dictionary cache) *//************************************************************************Gets the nth field of an index. */UNIV_INLINEdict_field_t*dict_index_get_nth_field(/*=====================*/ /* out: pointer to field object */ dict_index_t* index, /* in: index */ ulint pos); /* in: position of field *//************************************************************************Gets pointer to the nth field data type in an index. */UNIV_INLINEdtype_t*dict_index_get_nth_type(/*====================*/ /* out: data type */ dict_index_t* index, /* in: index */ ulint pos); /* in: position of the field *//************************************************************************Gets the column number of the nth field in an index. */UNIV_INLINEulintdict_index_get_nth_col_no(/*======================*/ /* out: column number */ dict_index_t* index, /* in: index */ ulint pos); /* in: position of the field *//************************************************************************Looks for column n in an index. */ulintdict_index_get_nth_col_pos(/*=======================*/ /* out: position in internal representation of the index; if not contained, returns ULINT_UNDEFINED */ dict_index_t* index, /* in: index */ ulint n); /* in: column number *//************************************************************************Returns TRUE if the index contains a column or a prefix of that column. */ibooldict_index_contains_col_or_prefix(/*==============================*/ /* out: TRUE if contains the column or its prefix */ dict_index_t* index, /* in: index */ ulint n); /* in: column number *//************************************************************************Looks for a matching field in an index. The column has to be the same. Thecolumn in index must be complete, or must contain a prefix longer than thecolumn in index2. That is, we must be able to construct the prefix in index2from the prefix in index. */ulintdict_index_get_nth_field_pos(/*=========================*/ /* out: position in internal representation of the index; if not contained, returns ULINT_UNDEFINED */ dict_index_t* index, /* in: index from which to search */ dict_index_t* index2, /* in: index */ ulint n); /* in: field number in index2 *//************************************************************************Looks for column n position in the clustered index. */ulintdict_table_get_nth_col_pos(/*=======================*/ /* out: position in internal representation of the clustered index */ dict_table_t* table, /* in: table */ ulint n); /* in: column number */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -