drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
dict0boot.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef dict0boot_h
28#define dict0boot_h
29
30#include "univ.i"
31
32#include "mtr0mtr.h"
33#include "mtr0log.h"
34#include "ut0byte.h"
35#include "buf0buf.h"
36#include "fsp0fsp.h"
37#include "dict0dict.h"
38
39typedef byte dict_hdr_t;
40
41/**********************************************************************/
44UNIV_INTERN
45dict_hdr_t*
47/*=========*/
48 mtr_t* mtr);
49/**********************************************************************/
51UNIV_INTERN
52void
54/*================*/
55 table_id_t* table_id,
57 index_id_t* index_id,
59 ulint* space_id);
61/**********************************************************************/
64UNIV_INLINE
67/*=========================*/
68/**********************************************************************/
71UNIV_INLINE
74/*=================*/
75 const byte* field);
76/**********************************************************************/
78UNIV_INLINE
79void
81/*==================*/
82 byte* field,
83 row_id_t row_id);
84/*****************************************************************/
87UNIV_INTERN
88void
89dict_boot(void);
90/*===========*/
91/*****************************************************************/
93UNIV_INTERN
94void
95dict_create(void);
96/*=============*/
97
98
99/* Space id and page no where the dictionary header resides */
100#define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */
101#define DICT_HDR_PAGE_NO FSP_DICT_HDR_PAGE_NO
102
103/* The ids for the basic system tables and their indexes */
104#define DICT_TABLES_ID 1
105#define DICT_COLUMNS_ID 2
106#define DICT_INDEXES_ID 3
107#define DICT_FIELDS_ID 4
108/* The following is a secondary index on SYS_TABLES */
109#define DICT_TABLE_IDS_ID 5
110
111#define DICT_HDR_FIRST_ID 10 /* the ids for tables etc. start
112 from this number, except for basic
113 system tables and their above defined
114 indexes; ibuf tables and indexes are
115 assigned as the id the number
116 DICT_IBUF_ID_MIN plus the space id */
117#define DICT_IBUF_ID_MIN 0xFFFFFFFF00000000ULL
118
119/* The offset of the dictionary header on the page */
120#define DICT_HDR FSEG_PAGE_DATA
121
122/*-------------------------------------------------------------*/
123/* Dictionary header offsets */
124#define DICT_HDR_ROW_ID 0 /* The latest assigned row id */
125#define DICT_HDR_TABLE_ID 8 /* The latest assigned table id */
126#define DICT_HDR_INDEX_ID 16 /* The latest assigned index id */
127#define DICT_HDR_MAX_SPACE_ID 24 /* The latest assigned space id, or 0*/
128#define DICT_HDR_MIX_ID_LOW 28 /* Obsolete,always DICT_HDR_FIRST_ID */
129#define DICT_HDR_TABLES 32 /* Root of the table index tree */
130#define DICT_HDR_TABLE_IDS 36 /* Root of the table index tree */
131#define DICT_HDR_COLUMNS 40 /* Root of the column index tree */
132#define DICT_HDR_INDEXES 44 /* Root of the index index tree */
133#define DICT_HDR_FIELDS 48 /* Root of the index field
134 index tree */
135
136#define DICT_HDR_FSEG_HEADER 56 /* Segment header for the tablespace
137 segment into which the dictionary
138 header is created */
139/*-------------------------------------------------------------*/
140
141/* The field number of the page number field in the sys_indexes table
142clustered index */
143#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
144#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
145#define DICT_SYS_INDEXES_TYPE_FIELD 6
146#define DICT_SYS_INDEXES_NAME_FIELD 4
147
148/* When a row id which is zero modulo this number (which must be a power of
149two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is
150updated */
151#define DICT_HDR_ROW_ID_WRITE_MARGIN 256
152
153#ifndef UNIV_NONINL
154#include "dict0boot.ic"
155#endif
156
157#endif
UNIV_INTERN void dict_hdr_get_new_id(table_id_t *table_id, index_id_t *index_id, ulint *space_id)
Definition dict0boot.cc:68
UNIV_INTERN void dict_boot(void)
Definition dict0boot.cc:247
UNIV_INTERN dict_hdr_t * dict_hdr_get(mtr_t *mtr)
Definition dict0boot.cc:48
UNIV_INLINE void dict_sys_write_row_id(byte *field, row_id_t row_id)
UNIV_INTERN void dict_create(void)
Definition dict0boot.cc:473
UNIV_INLINE row_id_t dict_sys_get_new_row_id(void)
UNIV_INLINE row_id_t dict_sys_read_row_id(const byte *field)
ib_id_t row_id_t
Definition trx0types.h:83