drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
dict0crea.h File Reference
#include "univ.i"
#include "dict0types.h"
#include "dict0dict.h"
#include "que0types.h"
#include "row0types.h"
#include "mtr0mtr.h"
Include dependency graph for dict0crea.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tab_node_struct
struct  ind_node_struct

Macros

#define dict0crea_h
#define TABLE_BUILD_TABLE_DEF   1
#define TABLE_BUILD_COL_DEF   2
#define TABLE_COMMIT_WORK   3
#define TABLE_ADD_TO_CACHE   4
#define TABLE_COMPLETED   5
#define INDEX_BUILD_INDEX_DEF   1
#define INDEX_BUILD_FIELD_DEF   2
#define INDEX_CREATE_INDEX_TREE   3
#define INDEX_COMMIT_WORK   4
#define INDEX_ADD_TO_CACHE   5

Functions

UNIV_INTERN tab_node_t * tab_create_graph_create (dict_table_t *table, mem_heap_t *heap)
UNIV_INTERN ind_node_t * ind_create_graph_create (dict_index_t *index, mem_heap_t *heap)
UNIV_INTERN que_thr_t * dict_create_table_step (que_thr_t *thr)
UNIV_INTERN que_thr_t * dict_create_index_step (que_thr_t *thr)
UNIV_INTERN ulint dict_truncate_index_tree (dict_table_t *table, ulint space, btr_pcur_t *pcur, mtr_t *mtr)
UNIV_INTERN void dict_drop_index_tree (rec_t *rec, mtr_t *mtr)
UNIV_INTERN ulint dict_create_or_check_foreign_constraint_tables (void)
UNIV_INTERN ulint dict_create_add_foreigns_to_dictionary (ulint start_id, dict_table_t *table, trx_t *trx)

Detailed Description

Database object creation

Created 1/8/1996 Heikki Tuuri

Definition in file dict0crea.h.

Macro Definition Documentation

◆ dict0crea_h

#define dict0crea_h

Definition at line 28 of file dict0crea.h.

◆ INDEX_ADD_TO_CACHE

#define INDEX_ADD_TO_CACHE   5

Definition at line 192 of file dict0crea.h.

◆ INDEX_BUILD_FIELD_DEF

#define INDEX_BUILD_FIELD_DEF   2

Definition at line 189 of file dict0crea.h.

◆ INDEX_BUILD_INDEX_DEF

#define INDEX_BUILD_INDEX_DEF   1

Definition at line 188 of file dict0crea.h.

◆ INDEX_COMMIT_WORK

#define INDEX_COMMIT_WORK   4

Definition at line 191 of file dict0crea.h.

◆ INDEX_CREATE_INDEX_TREE

#define INDEX_CREATE_INDEX_TREE   3

Definition at line 190 of file dict0crea.h.

◆ TABLE_ADD_TO_CACHE

#define TABLE_ADD_TO_CACHE   4

Definition at line 159 of file dict0crea.h.

◆ TABLE_BUILD_COL_DEF

#define TABLE_BUILD_COL_DEF   2

Definition at line 157 of file dict0crea.h.

◆ TABLE_BUILD_TABLE_DEF

#define TABLE_BUILD_TABLE_DEF   1

Definition at line 156 of file dict0crea.h.

◆ TABLE_COMMIT_WORK

#define TABLE_COMMIT_WORK   3

Definition at line 158 of file dict0crea.h.

◆ TABLE_COMPLETED

#define TABLE_COMPLETED   5

Definition at line 160 of file dict0crea.h.

Function Documentation

◆ dict_create_add_foreigns_to_dictionary()

UNIV_INTERN ulint dict_create_add_foreigns_to_dictionary ( ulint start_id,
dict_table_t * table,
trx_t * trx )

Adds foreign key definitions to data dictionary tables in the database. We look at table->foreign_list, and also generate names to constraints that were not named by the user. A generated constraint has a name of the format databasename/tablename_ibfk_<number>, where the numbers start from 1, and are given locally for this table, that is, the number is not global, as in the old format constraints < 4.0.18 it used to be.

Returns
error code or DB_SUCCESS in: transaction

Adds foreign key definitions to data dictionary tables in the database.

Returns
error code or DB_SUCCESS
Parameters
start_idin: if we are actually doing ALTER TABLE ADD CONSTRAINT, we want to generate constraint numbers which are bigger than in the table so far; we number the constraints from start_id + 1 up; start_id should be set to 0 if we are creating a new table, or if the table so far has no constraints for which the name was generated here
tablein: table
trxin: transaction

Definition at line 1488 of file dict0crea.cc.

◆ dict_create_index_step()

UNIV_INTERN que_thr_t * dict_create_index_step ( que_thr_t * thr)

Creates an index. This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL in: query thread

Creates an index. This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL
Parameters
thrin: query thread

Definition at line 1058 of file dict0crea.cc.

◆ dict_create_or_check_foreign_constraint_tables()

UNIV_INTERN ulint dict_create_or_check_foreign_constraint_tables ( void )

Creates the foreign key constraints system tables inside InnoDB at database creation or database start if they are not found or are not of the right form.

Returns
DB_SUCCESS or error code

Definition at line 1193 of file dict0crea.cc.

◆ dict_create_table_step()

UNIV_INTERN que_thr_t * dict_create_table_step ( que_thr_t * thr)

Creates a table. This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL in: query thread

Creates a table. This is a high-level function used in SQL execution graphs.

Returns
query thread to run next or NULL
Parameters
thrin: query thread

Definition at line 951 of file dict0crea.cc.

◆ dict_drop_index_tree()

UNIV_INTERN void dict_drop_index_tree ( rec_t * rec,
mtr_t * mtr )

Drops the index tree associated with a row in SYS_INDEXES table. in: mtr having the latch on the record page

Drops the index tree associated with a row in SYS_INDEXES table.

Parameters
recin/out: record in the clustered index of SYS_INDEXES table
mtrin: mtr having the latch on the record page

Definition at line 680 of file dict0crea.cc.

◆ dict_truncate_index_tree()

UNIV_INTERN ulint dict_truncate_index_tree ( dict_table_t * table,
ulint space,
btr_pcur_t * pcur,
mtr_t * mtr )

Truncates the index tree associated with a row in SYS_INDEXES table.

Returns
new root page number, or FIL_NULL on failure in: mtr having the latch on the record page. The mtr may be committed and restarted in this call.

Truncates the index tree associated with a row in SYS_INDEXES table.

Returns
new root page number, or FIL_NULL on failure
Parameters
tablein: the table the index belongs to
spacein: 0=truncate, nonzero=create the index tree in the given tablespace
pcurin/out: persistent cursor pointing to record in the clustered index of SYS_INDEXES table. The cursor may be repositioned in this call.
mtrin: mtr having the latch on the record page. The mtr may be committed and restarted in this call.

Definition at line 744 of file dict0crea.cc.

◆ ind_create_graph_create()

UNIV_INTERN ind_node_t * ind_create_graph_create ( dict_index_t * index,
mem_heap_t * heap )

Creates an index create graph.

Returns
own: index create node in: heap where created

Creates an index create graph.

Returns
own: index create node
Parameters
indexin: index to create, built as a memory data structure
heapin: heap where created

Definition at line 914 of file dict0crea.cc.

◆ tab_create_graph_create()

UNIV_INTERN tab_node_t * tab_create_graph_create ( dict_table_t * table,
mem_heap_t * heap )

Creates a table create graph.

Returns
own: table create node in: heap where created

Creates a table create graph.

Returns
own: table create node
Parameters
tablein: table to create, built as a memory data structure
heapin: heap where created

Definition at line 878 of file dict0crea.cc.