MySQL 9.1.0
Source Code Documentation
dict0crea.ic File Reference

Database object creation. More...

#include "ha_prototypes.h"
#include "mem0mem.h"

Functions

bool row_is_mysql_tmp_table_name (const char *name)
 Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL. 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...
 
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...
 

Detailed Description

Database object creation.

Created 1/8/1996 Heikki Tuuri

Function Documentation

◆ dict_create_add_foreign_id()

static dberr_t dict_create_add_foreign_id ( ulint id_nr,
const char *  name,
dict_foreign_t foreign 
)
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.

Parameters
id_nrin/out: number to use in id generation; incremented if used
namein: table name
foreignin/out: foreign key

◆ dict_create_v_col_pos()

static ulint dict_create_v_col_pos ( ulint  v_pos,
ulint  col_pos 
)
inlinestatic

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

Parameters
[in]v_posvirtual column sequence
[in]col_poscolumn position in original table definition
Returns
composed column position number

◆ dict_get_v_col_mysql_pos()

static ulint dict_get_v_col_mysql_pos ( ulint  pos)
inlinestatic

Get the column number for a virtual column (the column position in original table), stored in the "POS" field of Sys_columns.

Parameters
[in]posvirtual column position
Returns
column position in original table

◆ dict_get_v_col_pos()

static ulint dict_get_v_col_pos ( ulint  pos)
inlinestatic

Get a virtual column sequence (the "nth" virtual column) for a virtual column, stord in the "POS" field of Sys_columns.

Parameters
[in]posvirtual column position
Returns
virtual column sequence

◆ row_is_mysql_tmp_table_name()

bool row_is_mysql_tmp_table_name ( const char *  name)

Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL.

Returns
true if temporary table in: table name in the form 'database/tablename'