MySQL 8.4.2
Source Code Documentation
|
Database object creation. More...
#include "dict0dict.h"
#include "dict0types.h"
#include "fsp0space.h"
#include "mtr0mtr.h"
#include "que0types.h"
#include "row0types.h"
#include "sql/handler.h"
#include "univ.i"
#include "dict0crea.ic"
Go to the source code of this file.
Classes | |
struct | tab_node_t |
struct | ind_node_t |
Functions | |
dberr_t | dict_build_table_def (dict_table_t *table, const HA_CREATE_INFO *create_info, trx_t *trx) |
Build a table definition without updating SYSTEM TABLES. More... | |
dberr_t | dict_build_tablespace (trx_t *trx, Tablespace *tablespace) |
Builds a tablespace to store various objects. More... | |
dberr_t | dict_build_tablespace_for_table (dict_table_t *table, const HA_CREATE_INFO *create_info, trx_t *trx) |
Builds a tablespace to contain a table, using file-per-table=1. More... | |
void | dict_table_assign_new_id (dict_table_t *table) |
Assign a new table ID and put it into the table cache and the transaction. More... | |
void | dict_build_index_def (const dict_table_t *table, dict_index_t *index, trx_t *trx) |
Builds an index definition but doesn't update sys_table. More... | |
dberr_t | dict_create_index_tree_in_mem (dict_index_t *index, trx_t *trx) |
Creates an index tree for the index if it is not a member of a cluster. More... | |
void | dict_drop_temporary_table_index (const dict_index_t *index, page_no_t root_page_no) |
Drop an index tree belonging to a temporary table. More... | |
static dberr_t | dict_create_add_foreign_id (ulint *id_nr, const char *name, dict_foreign_t *foreign) |
Generate a foreign key constraint name when it was not named by the user. More... | |
bool | dict_foreigns_has_s_base_col (const dict_foreign_set &local_fk_set, const dict_table_t *table) |
Check if a foreign constraint is on columns served as base columns of any stored column. More... | |
dict_index_t * | dict_sdi_create_idx_in_mem (space_id_t space, bool space_discarded, uint32_t in_flags, bool is_create) |
Create in-memory tablespace dictionary index & table. More... | |
static ulint | dict_create_v_col_pos (ulint v_pos, ulint col_pos) |
Compose a column number for a virtual column, stored in the "POS" field of Sys_columns. More... | |
static ulint | dict_get_v_col_mysql_pos (ulint pos) |
Get the column number for a virtual column (the column position in original table), stored in the "POS" field of Sys_columns. More... | |
static ulint | dict_get_v_col_pos (ulint pos) |
Get a virtual column sequence (the "nth" virtual column) for a virtual column, stord in the "POS" field of Sys_columns. More... | |
Database object creation.
Created 1/8/1996 Heikki Tuuri
void dict_build_index_def | ( | const dict_table_t * | table, |
dict_index_t * | index, | ||
trx_t * | trx | ||
) |
Builds an index definition but doesn't update sys_table.
in/out: InnoDB transaction handle
Builds an index definition but doesn't update sys_table.
table | in: table |
index | in/out: index |
trx | in/out: InnoDB transaction handle |
dberr_t dict_build_table_def | ( | dict_table_t * | table, |
const HA_CREATE_INFO * | create_info, | ||
trx_t * | trx | ||
) |
Build a table definition without updating SYSTEM TABLES.
[in,out] | table | dict table object |
[in] | create_info | HA_CREATE_INFO object |
[in,out] | trx | transaction instance |
In-memory counter used for assigning table_id of data dictionary table. This counter is only used during bootstrap or upgrade
dberr_t dict_build_tablespace | ( | trx_t * | trx, |
Tablespace * | tablespace | ||
) |
Builds a tablespace to store various objects.
[in,out] | trx | DD transaction |
[in,out] | tablespace | Tablespace object describing what to build. |
dberr_t dict_build_tablespace_for_table | ( | dict_table_t * | table, |
const HA_CREATE_INFO * | create_info, | ||
trx_t * | trx | ||
) |
Builds a tablespace to contain a table, using file-per-table=1.
[in,out] | table | Table to build in its own tablespace. |
[in] | create_info | HA_CREATE_INFO object |
[in,out] | trx | Transaction |
|
inlinestatic |
Generate a foreign key constraint name when it was not named by the user.
A generated constraint has a name of the format dbname/tablename_ibfk_NUMBER, where the numbers start from 1, and are given locally for this table, that is, the number is not global, as it used to be before MySQL 4.0.18.
[in,out] | id_nr | number to use in id generation; incremented if used |
[in] | name | table name |
[in,out] | foreign | foreign key |
dberr_t dict_create_index_tree_in_mem | ( | dict_index_t * | index, |
trx_t * | trx | ||
) |
Creates an index tree for the index if it is not a member of a cluster.
[in,out] | index | InnoDB index object |
[in,out] | trx | transaction |
Compose a column number for a virtual column, stored in the "POS" field of Sys_columns.
The column number includes both its virtual column sequence (the "nth" virtual column) and its actual column position in original table
[in] | v_pos | virtual column sequence |
[in] | col_pos | column position in original table definition |
void dict_drop_temporary_table_index | ( | const dict_index_t * | index, |
page_no_t | root_page_no | ||
) |
Drop an index tree belonging to a temporary table.
[in] | index | index in a temporary table |
[in] | root_page_no | index root page number |
bool dict_foreigns_has_s_base_col | ( | const dict_foreign_set & | local_fk_set, |
const dict_table_t * | table | ||
) |
Check if a foreign constraint is on columns served as base columns of any stored column.
This is to prevent creating SET NULL or CASCADE constraint on such columns
[in] | local_fk_set | set of foreign key objects, to be added to the dictionary tables |
[in] | table | table to which the foreign key objects in local_fk_set belong to |
Get the column number for a virtual column (the column position in original table), stored in the "POS" field of Sys_columns.
[in] | pos | virtual column position |
Get a virtual column sequence (the "nth" virtual column) for a virtual column, stord in the "POS" field of Sys_columns.
[in] | pos | virtual column position |
dict_index_t * dict_sdi_create_idx_in_mem | ( | space_id_t | space, |
bool | space_discarded, | ||
uint32_t | in_flags, | ||
bool | is_create | ||
) |
Create in-memory tablespace dictionary index & table.
[in] | space | tablespace id |
[in] | space_discarded | true if space is discarded |
[in] | in_flags | space flags to use when space_discarded is true |
[in] | is_create | true when creating SDI index |
void dict_table_assign_new_id | ( | dict_table_t * | table | ) |
Assign a new table ID and put it into the table cache and the transaction.
[in,out] | table | Table that needs an ID |