MySQL 9.6.0
Source Code Documentation
dict0boot.h File Reference

Data dictionary creation and booting. More...

#include "univ.i"
#include "buf0buf.h"
#include "dict0dict.h"
#include "fsp0fsp.h"
#include "mtr0log.h"
#include "mtr0mtr.h"
#include "ut0byte.h"
#include "dict0boot.ic"

Go to the source code of this file.

Typedefs

typedef byte dict_hdr_t
 

Functions

dict_hdr_tdict_hdr_get (mtr_t *mtr)
 Gets a pointer to the dictionary header and x-latches its page. More...
 
void dict_hdr_get_new_id (table_id_t *table_id, space_index_t *index_id, space_id_t *space_id, const dict_table_t *table, bool disable_redo)
 Returns a new table, index, or space id. More...
 
static row_id_t dict_sys_get_new_row_id ()
 Returns a new row id. More...
 
static row_id_t dict_sys_read_row_id (const byte *field)
 Reads a row id from a record or other 6-byte stored form. More...
 
static void dict_sys_write_row_id (byte *field, row_id_t row_id)
 Writes a row id to a record or other 6-byte stored form. More...
 
dberr_t dict_boot ()
 Initializes the data dictionary memory structures when the database is started. More...
 
dberr_t dict_create ()
 Creates and initializes the data dictionary at the server bootstrap. More...
 

Variables

constexpr uint32_t DICT_HDR_FIRST_ID = 10
 the ids for tables etc. More...
 
constexpr uint32_t DICT_HDR = FSEG_PAGE_DATA
 
constexpr uint32_t DICT_HDR_ROW_ID = 0
 The latest assigned row id. More...
 
constexpr uint32_t DICT_HDR_TABLE_ID = 8
 The latest assigned table id. More...
 
constexpr uint32_t DICT_HDR_INDEX_ID = 16
 The latest assigned index id. More...
 
constexpr uint32_t DICT_HDR_MAX_SPACE_ID = 24
 The latest assigned space id,or 0. More...
 
constexpr uint32_t DICT_HDR_MIX_ID_LOW = 28
 Obsolete,always DICT_HDR_FIRST_ID. More...
 
constexpr uint32_t DICT_HDR_FSEG_HEADER = 56
 
constexpr uint32_t DICT_HDR_ROW_ID_WRITE_MARGIN = 256
 

Detailed Description

Data dictionary creation and booting.

Created 4/18/1996 Heikki Tuuri

Typedef Documentation

◆ dict_hdr_t

typedef byte dict_hdr_t

Function Documentation

◆ dict_boot()

dberr_t dict_boot ( )

Initializes the data dictionary memory structures when the database is started.

This function is also called when the data dictionary is created.

Returns
DB_SUCCESS or error code.

◆ dict_create()

dberr_t dict_create ( )

Creates and initializes the data dictionary at the server bootstrap.

Returns
DB_SUCCESS or error code.

◆ dict_hdr_get()

dict_hdr_t * dict_hdr_get ( mtr_t mtr)

Gets a pointer to the dictionary header and x-latches its page.

Returns
pointer to the dictionary header, page x-latched in: mtr
pointer to the dictionary header, page x-latched
Parameters
mtrin: mtr

◆ dict_hdr_get_new_id()

void dict_hdr_get_new_id ( table_id_t table_id,
space_index_t index_id,
space_id_t space_id,
const dict_table_t table,
bool  disable_redo 
)

Returns a new table, index, or space id.

Parameters
[out]table_idTable id (not assigned if null)
[out]index_idIndex id (not assigned if null)
[out]space_idSpace id (not assigned if null)
[in]tableTable
[in]disable_redoIf true and table object is null then disable-redo

◆ dict_sys_get_new_row_id()

static row_id_t dict_sys_get_new_row_id ( )
inlinestatic

Returns a new row id.

Returns
the new id

◆ dict_sys_read_row_id()

static row_id_t dict_sys_read_row_id ( const byte field)
inlinestatic

Reads a row id from a record or other 6-byte stored form.

Returns
row id in: record field

◆ dict_sys_write_row_id()

static void dict_sys_write_row_id ( byte field,
row_id_t  row_id 
)
inlinestatic

Writes a row id to a record or other 6-byte stored form.

Parameters
[in]fieldrecord field
[in]row_idrow id

Variable Documentation

◆ DICT_HDR

constexpr uint32_t DICT_HDR = FSEG_PAGE_DATA
constexpr

◆ DICT_HDR_FIRST_ID

constexpr uint32_t DICT_HDR_FIRST_ID = 10
constexpr

the ids for tables etc.

start from this number, except for basic system tables and their above defined indexes; ibuf tables and indexes are assigned as the id the number DICT_IBUF_ID_MIN plus the space id

◆ DICT_HDR_FSEG_HEADER

constexpr uint32_t DICT_HDR_FSEG_HEADER = 56
constexpr

◆ DICT_HDR_INDEX_ID

constexpr uint32_t DICT_HDR_INDEX_ID = 16
constexpr

The latest assigned index id.

◆ DICT_HDR_MAX_SPACE_ID

constexpr uint32_t DICT_HDR_MAX_SPACE_ID = 24
constexpr

The latest assigned space id,or 0.

◆ DICT_HDR_MIX_ID_LOW

constexpr uint32_t DICT_HDR_MIX_ID_LOW = 28
constexpr

Obsolete,always DICT_HDR_FIRST_ID.

◆ DICT_HDR_ROW_ID

constexpr uint32_t DICT_HDR_ROW_ID = 0
constexpr

The latest assigned row id.

◆ DICT_HDR_ROW_ID_WRITE_MARGIN

constexpr uint32_t DICT_HDR_ROW_ID_WRITE_MARGIN = 256
constexpr

◆ DICT_HDR_TABLE_ID

constexpr uint32_t DICT_HDR_TABLE_ID = 8
constexpr

The latest assigned table id.