InnoDB Plugin
1.0
|
#include "data0type.h"
#include "dict0load.h"
#include "rem0types.h"
#include "fsp0fsp.h"
#include "srv0srv.h"
#include "sync0rw.h"
Functions | |
UNIV_INLINE ulint | dict_col_get_mbminlen (const dict_col_t *col) |
UNIV_INLINE ulint | dict_col_get_mbmaxlen (const dict_col_t *col) |
UNIV_INLINE void | dict_col_set_mbminmaxlen (dict_col_t *col, ulint mbminlen, ulint mbmaxlen) |
UNIV_INLINE void | dict_col_copy_type (const dict_col_t *col, dtype_t *type) |
UNIV_INLINE ibool | dict_col_type_assert_equal (const dict_col_t *col, const dtype_t *type) |
UNIV_INLINE ulint | dict_col_get_min_size (const dict_col_t *col) |
UNIV_INLINE ulint | dict_col_get_max_size (const dict_col_t *col) |
UNIV_INLINE ulint | dict_col_get_fixed_size (const dict_col_t *col, ulint comp) |
UNIV_INLINE ulint | dict_col_get_sql_null_size (const dict_col_t *col, ulint comp) |
UNIV_INLINE ulint | dict_col_get_no (const dict_col_t *col) |
UNIV_INLINE ulint | dict_col_get_clust_pos (const dict_col_t *col, const dict_index_t *clust_index) |
UNIV_INLINE dict_index_t * | dict_table_get_first_index (const dict_table_t *table) |
UNIV_INLINE dict_index_t * | dict_table_get_last_index (const dict_table_t *table) |
UNIV_INLINE dict_index_t * | dict_table_get_next_index (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_is_clust (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_is_unique (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_is_ibuf (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_is_univ (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_is_sec_or_ibuf (const dict_index_t *index) |
UNIV_INLINE ulint | dict_table_get_n_user_cols (const dict_table_t *table) |
UNIV_INLINE ulint | dict_table_get_n_sys_cols (const dict_table_t *table)) |
UNIV_INLINE ulint | dict_table_get_n_cols (const dict_table_t *table) |
UNIV_INLINE ib_uint64_t | dict_table_get_n_rows (const dict_table_t *table) |
UNIV_INLINE void | dict_table_n_rows_inc (dict_table_t *table) |
UNIV_INLINE void | dict_table_n_rows_dec (dict_table_t *table) |
UNIV_INLINE dict_col_t * | dict_table_get_nth_col (const dict_table_t *table, ulint pos) |
UNIV_INLINE dict_col_t * | dict_table_get_sys_col (const dict_table_t *table, ulint sys) |
UNIV_INLINE ulint | dict_table_get_sys_col_no (const dict_table_t *table, ulint sys) |
UNIV_INLINE ibool | dict_table_is_comp (const dict_table_t *table) |
UNIV_INLINE ibool | dict_table_has_fts_index (dict_table_t *table) |
UNIV_INLINE bool | dict_tf_is_valid (ulint flags) |
UNIV_INLINE ulint | dict_sys_tables_type_validate (ulint type, ulint n_cols) |
UNIV_INLINE rec_format_t | dict_tf_get_rec_format (ulint flags) |
UNIV_INLINE ulint | dict_tf_get_format (ulint flags) |
UNIV_INLINE ulint | dict_table_get_format (const dict_table_t *table) |
UNIV_INLINE void | dict_tf_set (ulint *flags, rec_format_t format, ulint zip_ssize, bool use_data_dir) |
UNIV_INLINE ulint | dict_tf_to_fsp_flags (ulint table_flags) |
UNIV_INLINE ulint | dict_sys_tables_type_to_tf (ulint type, ulint n_cols) |
UNIV_INLINE ulint | dict_tf_to_sys_tables_type (ulint flags) |
UNIV_INLINE ulint | dict_tf_get_zip_size (ulint flags) |
UNIV_INLINE ulint | dict_table_zip_size (const dict_table_t *table) |
UNIV_INLINE void | dict_table_x_lock_indexes (dict_table_t *table) |
UNIV_INLINE void | dict_table_x_unlock_indexes (dict_table_t *table) |
UNIV_INLINE ulint | dict_index_get_n_fields (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_get_n_unique (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_get_n_unique_in_tree (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_get_n_ordering_defined_by_user (const dict_index_t *index) |
UNIV_INLINE dict_field_t * | dict_index_get_nth_field (const dict_index_t *index, ulint pos) |
UNIV_INLINE ulint | dict_index_get_sys_col_pos (const dict_index_t *index, ulint type) |
UNIV_INLINE const dict_col_t * | dict_field_get_col (const dict_field_t *field) |
UNIV_INLINE const dict_col_t * | dict_index_get_nth_col (const dict_index_t *index, ulint pos) |
UNIV_INLINE ulint | dict_index_get_nth_col_no (const dict_index_t *index, ulint pos) |
UNIV_INLINE ulint | dict_index_get_nth_col_pos (const dict_index_t *index, ulint n) |
UNIV_INLINE ulint | dict_index_get_min_size (const dict_index_t *index) |
UNIV_INLINE ulint | dict_index_get_space (const dict_index_t *index) |
UNIV_INLINE void | dict_index_set_space (dict_index_t *index, ulint space) |
UNIV_INLINE ulint | dict_index_get_page (const dict_index_t *index) |
UNIV_INLINE rw_lock_t * | dict_index_get_lock (dict_index_t *index) |
UNIV_INLINE ulint | dict_index_get_space_reserve (void) |
UNIV_INLINE enum online_index_status | dict_index_get_online_status (const dict_index_t *index) |
UNIV_INLINE void | dict_index_set_online_status (dict_index_t *index, enum online_index_status status) |
UNIV_INLINE bool | dict_index_is_online_ddl (const dict_index_t *index) |
UNIV_INLINE ulint | dict_table_is_fts_column (ib_vector_t *indexes, ulint col_no) |
UNIV_INLINE ulint | dict_max_field_len_store_undo (dict_table_t *table, const dict_col_t *col) |
UNIV_INLINE ulint | dict_table_is_corrupted (const dict_table_t *table) |
UNIV_INLINE ulint | dict_index_is_corrupted (const dict_index_t *index) |
UNIV_INLINE bool | dict_table_is_discarded (const dict_table_t *table) |
UNIV_INLINE bool | dict_table_is_temporary (const dict_table_t *table) |
UNIV_INLINE dict_index_t * | dict_table_get_index_on_first_col (const dict_table_t *table, ulint col_index) |
Data dictionary system
Created 1/8/1996 Heikki Tuuri
UNIV_INLINE void dict_col_copy_type | ( | const dict_col_t * | col, |
dtype_t * | type | ||
) |
Gets the column data type.
col | in: column |
type | out: data type |
UNIV_INLINE ulint dict_col_get_clust_pos | ( | const dict_col_t * | col, |
const dict_index_t * | clust_index | ||
) |
Gets the column position in the clustered index.
col | in: table column |
clust_index | in: clustered index |
UNIV_INLINE ulint dict_col_get_fixed_size | ( | const dict_col_t * | col, |
ulint | comp | ||
) |
Returns the size of a fixed size column, 0 if not a fixed size column.
col | in: column |
comp | in: nonzero=ROW_FORMAT=COMPACT |
UNIV_INLINE ulint dict_col_get_max_size | ( | const dict_col_t * | col | ) |
Returns the maximum size of the column.
col | in: column |
UNIV_INLINE ulint dict_col_get_mbmaxlen | ( | const dict_col_t * | col | ) |
Gets the maximum number of bytes per character.
col | in: column |
UNIV_INLINE ulint dict_col_get_mbminlen | ( | const dict_col_t * | col | ) |
Gets the minimum number of bytes per character.
col | in: column |
UNIV_INLINE ulint dict_col_get_min_size | ( | const dict_col_t * | col | ) |
Returns the minimum size of the column.
col | in: column |
UNIV_INLINE ulint dict_col_get_no | ( | const dict_col_t * | col | ) |
Gets the column number.
col | in: column |
UNIV_INLINE ulint dict_col_get_sql_null_size | ( | const dict_col_t * | col, |
ulint | comp | ||
) |
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column. For fixed length types it is the fixed length of the type, otherwise 0.
col | in: column |
comp | in: nonzero=ROW_FORMAT=COMPACT |
UNIV_INLINE void dict_col_set_mbminmaxlen | ( | dict_col_t * | col, |
ulint | mbminlen, | ||
ulint | mbmaxlen | ||
) |
Sets the minimum and maximum number of bytes per character.
col | in/out: column |
mbminlen | in: minimum multi-byte character size, in bytes |
mbmaxlen | in: minimum multi-byte character size, in bytes |
UNIV_INLINE ibool dict_col_type_assert_equal | ( | const dict_col_t * | col, |
const dtype_t * | type | ||
) |
Assert that a column and a data type match.
col | in: column |
type | in: data type |
UNIV_INLINE const dict_col_t* dict_field_get_col | ( | const dict_field_t * | field | ) |
Gets the field column.
field | in: index field |
UNIV_INLINE rw_lock_t* dict_index_get_lock | ( | dict_index_t * | index | ) |
Gets the read-write lock of the index tree.
index | in: index |
UNIV_INLINE ulint dict_index_get_min_size | ( | const dict_index_t * | index | ) |
Returns the minimum data size of an index record.
index | in: index |
UNIV_INLINE ulint dict_index_get_n_fields | ( | const dict_index_t * | index | ) |
Gets the number of fields in the internal representation of an index, including fields added by the dictionary system.
index | in: an internal representation of index (in the dictionary cache) |
UNIV_INLINE ulint dict_index_get_n_ordering_defined_by_user | ( | const dict_index_t * | index | ) |
Gets the number of user-defined ordering fields in the index. In the internal representation of clustered indexes we add the row id to the ordering fields to make a clustered index unique, but this function returns the number of fields the user defined in the index as ordering fields.
index | in: an internal representation of index (in the dictionary cache) |
UNIV_INLINE ulint dict_index_get_n_unique | ( | const dict_index_t * | index | ) |
Gets the number of fields in the internal representation of an index that uniquely determine the position of an index entry in the index, if we do not take multiversioning into account: in the B-tree use the value returned by dict_index_get_n_unique_in_tree.
index | in: an internal representation of index (in the dictionary cache) |
UNIV_INLINE ulint dict_index_get_n_unique_in_tree | ( | const dict_index_t * | index | ) |
Gets the number of fields in the internal representation of an index which uniquely determine the position of an index entry in the index, if we also take multiversioning into account.
index | in: an internal representation of index (in the dictionary cache) |
UNIV_INLINE const dict_col_t* dict_index_get_nth_col | ( | const dict_index_t * | index, |
ulint | pos | ||
) |
Gets pointer to the nth column in an index.
index | in: index |
pos | in: position of the field |
UNIV_INLINE ulint dict_index_get_nth_col_no | ( | const dict_index_t * | index, |
ulint | pos | ||
) |
Gets the column number the nth field in an index.
index | in: index |
pos | in: position of the field |
UNIV_INLINE ulint dict_index_get_nth_col_pos | ( | const dict_index_t * | index, |
ulint | n | ||
) |
Looks for column n in an index.
index | in: index |
n | in: column number |
UNIV_INLINE dict_field_t* dict_index_get_nth_field | ( | const dict_index_t * | index, |
ulint | pos | ||
) |
Gets the nth field of an index.
index | in: index |
pos | in: position of field |
UNIV_INLINE enum online_index_status dict_index_get_online_status | ( | const dict_index_t * | index | ) |
Gets the status of online index creation.
index | in: secondary index |
UNIV_INLINE ulint dict_index_get_page | ( | const dict_index_t * | index | ) |
Gets the page number of the root of the index tree.
index | in: index |
UNIV_INLINE ulint dict_index_get_space | ( | const dict_index_t * | index | ) |
Gets the space id of the root of the index tree.
index | in: index |
UNIV_INLINE ulint dict_index_get_space_reserve | ( | void | ) |
Returns free space reserved for future updates of records. This is relevant only in the case of many consecutive inserts, as updates which make the records bigger might fragment the index.
UNIV_INLINE ulint dict_index_get_sys_col_pos | ( | const dict_index_t * | index, |
ulint | type | ||
) |
Returns the position of a system column in an index.
index | in: index |
type | in: DATA_ROW_ID, ... |
UNIV_INLINE ulint dict_index_is_clust | ( | const dict_index_t * | index | ) |
Check whether the index is the clustered index.
index | in: index |
UNIV_INLINE ulint dict_index_is_corrupted | ( | const dict_index_t * | index | ) |
Check whether the index is corrupted.
index | in: index |
UNIV_INLINE ulint dict_index_is_ibuf | ( | const dict_index_t * | index | ) |
Check whether the index is the insert buffer tree.
index | in: index |
UNIV_INLINE bool dict_index_is_online_ddl | ( | const dict_index_t * | index | ) |
Determines if a secondary index is being or has been created online, or if the table is being rebuilt online, allowing concurrent modifications to the table.
true | if the index is being or has been built online, or if this is a clustered index and the table is being or has been rebuilt online |
false | if the index has been created or the table has been rebuilt completely |
index | in: index |
UNIV_INLINE ulint dict_index_is_sec_or_ibuf | ( | const dict_index_t * | index | ) |
Check whether the index is a secondary index or the insert buffer tree.
index | in: index |
UNIV_INLINE ulint dict_index_is_unique | ( | const dict_index_t * | index | ) |
Check whether the index is unique.
index | in: index |
UNIV_INLINE ulint dict_index_is_univ | ( | const dict_index_t * | index | ) |
Check whether the index is an universal index tree.
index | in: index |
UNIV_INLINE void dict_index_set_online_status | ( | dict_index_t * | index, |
enum online_index_status | status | ||
) |
Sets the status of online index creation.
index | in/out: index |
status | in: status |
UNIV_INLINE void dict_index_set_space | ( | dict_index_t * | index, |
ulint | space | ||
) |
Sets the space id of the root of the index tree.
index | in/out: index |
space | in: space id |
UNIV_INLINE ulint dict_max_field_len_store_undo | ( | dict_table_t * | table, |
const dict_col_t * | col | ||
) |
Determine bytes of column prefix to be stored in the undo log. Please note if the table format is UNIV_FORMAT_A (< UNIV_FORMAT_B), no prefix needs to be stored in the undo log.
table | in: table |
col | in: column which index prefix is based on |
UNIV_INLINE ulint dict_sys_tables_type_to_tf | ( | ulint | type, |
ulint | n_cols | ||
) |
Convert a 32 bit integer from SYS_TABLES.TYPE to dict_table_t::flags The following chart shows the translation of the low order bit. Other bits are the same. ========================= Low order bit ========================== | REDUNDANT | COMPACT | COMPRESSED and DYNAMIC SYS_TABLES.TYPE | 1 | 1 | 1
type | in: SYS_TABLES.TYPE field |
n_cols | in: SYS_TABLES.N_COLS field |
UNIV_INLINE ulint dict_sys_tables_type_validate | ( | ulint | type, |
ulint | n_cols | ||
) |
Validate a SYS_TABLES TYPE field and return it.
type | in: SYS_TABLES.TYPE |
n_cols | in: SYS_TABLES.N_COLS |
UNIV_INLINE dict_index_t* dict_table_get_first_index | ( | const dict_table_t * | table | ) |
Gets the first index on the table (the clustered index).
table | in: table |
UNIV_INLINE ulint dict_table_get_format | ( | const dict_table_t * | table | ) |
Determine the file format of a table.
table | in: table |
UNIV_INLINE dict_index_t* dict_table_get_index_on_first_col | ( | const dict_table_t * | table, |
ulint | col_index | ||
) |
Get index by first field of the index
table | in: table |
col_index | in: position of column in table |
UNIV_INLINE dict_index_t* dict_table_get_last_index | ( | const dict_table_t * | table | ) |
Gets the last index on the table.
table | in: table |
UNIV_INLINE ulint dict_table_get_n_cols | ( | const dict_table_t * | table | ) |
Gets the number of all columns (also system) in a table in the dictionary cache.
table | in: table |
UNIV_INLINE ib_uint64_t dict_table_get_n_rows | ( | const dict_table_t * | table | ) |
Gets the approximately estimated number of rows in the table.
table | in: table |
UNIV_INLINE ulint dict_table_get_n_sys_cols | ( | const dict_table_t * | table | ) |
Gets the number of system columns in a table in the dictionary cache.
< in: table
table | in: table |
UNIV_INLINE ulint dict_table_get_n_user_cols | ( | const dict_table_t * | table | ) |
Gets the number of user-defined columns in a table in the dictionary cache.
table | in: table |
UNIV_INLINE dict_index_t* dict_table_get_next_index | ( | const dict_index_t * | index | ) |
Gets the next index on the table.
index | in: index |
UNIV_INLINE dict_col_t* dict_table_get_nth_col | ( | const dict_table_t * | table, |
ulint | pos | ||
) |
Gets the nth column of a table.
table | in: table |
pos | in: position of column |
UNIV_INLINE dict_col_t* dict_table_get_sys_col | ( | const dict_table_t * | table, |
ulint | sys | ||
) |
Gets the given system column of a table.
table | in: table |
sys | in: DATA_ROW_ID, ... |
UNIV_INLINE ulint dict_table_get_sys_col_no | ( | const dict_table_t * | table, |
ulint | sys | ||
) |
Gets the given system column number of a table.
table | in: table |
sys | in: DATA_ROW_ID, ... |
UNIV_INLINE ibool dict_table_has_fts_index | ( | dict_table_t * | table | ) |
Check if the table has an FTS index.
table | in: table |
UNIV_INLINE ibool dict_table_is_comp | ( | const dict_table_t * | table | ) |
Check whether the table uses the compact page format.
table | in: table |
UNIV_INLINE ulint dict_table_is_corrupted | ( | const dict_table_t * | table | ) |
Check whether the table is corrupted.
table | in: table |
UNIV_INLINE bool dict_table_is_discarded | ( | const dict_table_t * | table | ) |
Check if the tablespace for the table has been discarded.
table | in: table to check |
UNIV_INLINE ulint dict_table_is_fts_column | ( | ib_vector_t * | indexes, |
ulint | col_no | ||
) |
Check whether a column exists in an FTS index.
indexes | in: vector containing only FTS indexes |
col_no | in: col number to search for |
UNIV_INLINE bool dict_table_is_temporary | ( | const dict_table_t * | table | ) |
Check if it is a temporary table.
table | in: table to check |
UNIV_INLINE void dict_table_n_rows_dec | ( | dict_table_t * | table | ) |
Decrement the number of rows in the table by one. Notice that this operation is not protected by any latch, the number is approximate.
table | in/out: table |
UNIV_INLINE void dict_table_n_rows_inc | ( | dict_table_t * | table | ) |
Increment the number of rows in the table by one. Notice that this operation is not protected by any latch, the number is approximate.
table | in/out: table |
UNIV_INLINE void dict_table_x_lock_indexes | ( | dict_table_t * | table | ) |
Obtain exclusive locks on all index trees of the table. This is to prevent accessing index trees while InnoDB is updating internal metadata for operations such as truncate tables.
table | in: table |
UNIV_INLINE void dict_table_x_unlock_indexes | ( | dict_table_t * | table | ) |
Release the exclusive locks on all index tree.
table | in: table |
UNIV_INLINE ulint dict_table_zip_size | ( | const dict_table_t * | table | ) |
Check whether the table uses the compressed compact page format.
table | in: table |
UNIV_INLINE ulint dict_tf_get_format | ( | ulint | flags | ) |
Determine the file format from a dict_table_t::flags.
flags | in: dict_table_t::flags |
UNIV_INLINE rec_format_t dict_tf_get_rec_format | ( | ulint | flags | ) |
Determine the file format from dict_table_t::flags The low order bit will be zero for REDUNDANT and 1 for COMPACT. For any other row_format, file_format is > 0 and DICT_TF_COMPACT will also be set.
flags | in: dict_table_t::flags |
UNIV_INLINE ulint dict_tf_get_zip_size | ( | ulint | flags | ) |
Extract the compressed page size from dict_table_t::flags. These flags are in memory, so assert that they are valid.
flags | in: flags |
UNIV_INLINE bool dict_tf_is_valid | ( | ulint | flags | ) |
Validate the table flags.
flags | in: table flags |
UNIV_INLINE void dict_tf_set | ( | ulint * | flags, |
rec_format_t | format, | ||
ulint | zip_ssize, | ||
bool | use_data_dir | ||
) |
Set the file format and zip size in a dict_table_t::flags. If zip size is not needed, it should be 0.
flags | in/out: table flags |
format | in: file format |
zip_ssize | in: zip shift size |
use_data_dir | in: table uses DATA DIRECTORY |
UNIV_INLINE ulint dict_tf_to_fsp_flags | ( | ulint | table_flags | ) |
Convert a 32 bit integer table flags to the 32 bit integer that is written into the tablespace header at the offset FSP_SPACE_FLAGS and is also stored in the fil_space_t::flags field. The following chart shows the translation of the low order bit. Other bits are the same. ========================= Low order bit ========================== | REDUNDANT | COMPACT | COMPRESSED | DYNAMIC dict_table_t::flags | 0 | 1 | 1 | 1
table_flags | in: dict_table_t::flags |
UNIV_INLINE ulint dict_tf_to_sys_tables_type | ( | ulint | flags | ) |
Convert a 32 bit integer table flags to the 32bit integer that is written to a SYS_TABLES.TYPE field. The following chart shows the translation of the low order bit. Other bits are the same. ========================= Low order bit ========================== | REDUNDANT | COMPACT | COMPRESSED and DYNAMIC dict_table_t::flags | 0 | 1 | 1
flags | in: dict_table_t::flags |