~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/dict0boot.h

  • Committer: Monty Taylor
  • Date: 2009-03-20 04:49:49 UTC
  • mto: (950.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 958.
  • Revision ID: mordred@inaugust.com-20090320044949-nfx7ygyy89ojl6v5
RemovedĀ unusedĀ code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/**************************************************//**
20
 
@file include/dict0boot.h
 
19
/******************************************************
21
20
Data dictionary creation and booting
22
21
 
23
22
Created 4/18/1996 Heikki Tuuri
37
36
 
38
37
typedef byte    dict_hdr_t;
39
38
 
40
 
/**********************************************************************//**
41
 
Gets a pointer to the dictionary header and x-latches its page.
42
 
@return pointer to the dictionary header, page x-latched */
 
39
/**************************************************************************
 
40
Gets a pointer to the dictionary header and x-latches its page. */
43
41
UNIV_INTERN
44
42
dict_hdr_t*
45
43
dict_hdr_get(
46
44
/*=========*/
47
 
        mtr_t*  mtr);   /*!< in: mtr */
48
 
/**********************************************************************//**
49
 
Returns a new table, index, or space id. */
 
45
                        /* out: pointer to the dictionary header,
 
46
                        page x-latched */
 
47
        mtr_t*  mtr);   /* in: mtr */
 
48
/**************************************************************************
 
49
Returns a new row, table, index, or tree id. */
50
50
UNIV_INTERN
51
 
void
 
51
dulint
52
52
dict_hdr_get_new_id(
53
53
/*================*/
54
 
        table_id_t*     table_id,       /*!< out: table id
55
 
                                        (not assigned if NULL) */
56
 
        index_id_t*     index_id,       /*!< out: index id
57
 
                                        (not assigned if NULL) */
58
 
        ulint*          space_id);      /*!< out: space id
59
 
                                        (not assigned if NULL) */
60
 
/**********************************************************************//**
61
 
Returns a new row id.
62
 
@return the new id */
 
54
                        /* out: the new id */
 
55
        ulint   type);  /* in: DICT_HDR_ROW_ID, ... */
 
56
/**************************************************************************
 
57
Returns a new row id. */
63
58
UNIV_INLINE
64
 
row_id_t
 
59
dulint
65
60
dict_sys_get_new_row_id(void);
66
61
/*=========================*/
67
 
/**********************************************************************//**
68
 
Reads a row id from a record or other 6-byte stored form.
69
 
@return row id */
 
62
                        /* out: the new id */
 
63
/**************************************************************************
 
64
Reads a row id from a record or other 6-byte stored form. */
70
65
UNIV_INLINE
71
 
row_id_t
 
66
dulint
72
67
dict_sys_read_row_id(
73
68
/*=================*/
74
 
        const byte*     field); /*!< in: record field */
75
 
/**********************************************************************//**
 
69
                        /* out: row id */
 
70
        byte*   field); /* in: record field */
 
71
/**************************************************************************
76
72
Writes a row id to a record or other 6-byte stored form. */
77
73
UNIV_INLINE
78
74
void
79
75
dict_sys_write_row_id(
80
76
/*==================*/
81
 
        byte*           field,  /*!< in: record field */
82
 
        row_id_t        row_id);/*!< in: row id */
83
 
/*****************************************************************//**
 
77
        byte*   field,  /* in: record field */
 
78
        dulint  row_id);/* in: row id */
 
79
/*********************************************************************
84
80
Initializes the data dictionary memory structures when the database is
85
81
started. This function is also called when the data dictionary is created. */
86
82
UNIV_INTERN
87
83
void
88
84
dict_boot(void);
89
85
/*===========*/
90
 
/*****************************************************************//**
 
86
/*********************************************************************
91
87
Creates and initializes the data dictionary at the database creation. */
92
88
UNIV_INTERN
93
89
void
100
96
#define DICT_HDR_PAGE_NO        FSP_DICT_HDR_PAGE_NO
101
97
 
102
98
/* The ids for the basic system tables and their indexes */
103
 
#define DICT_TABLES_ID          1
104
 
#define DICT_COLUMNS_ID         2
105
 
#define DICT_INDEXES_ID         3
106
 
#define DICT_FIELDS_ID          4
 
99
#define DICT_TABLES_ID          ut_dulint_create(0, 1)
 
100
#define DICT_COLUMNS_ID         ut_dulint_create(0, 2)
 
101
#define DICT_INDEXES_ID         ut_dulint_create(0, 3)
 
102
#define DICT_FIELDS_ID          ut_dulint_create(0, 4)
107
103
/* The following is a secondary index on SYS_TABLES */
108
 
#define DICT_TABLE_IDS_ID       5
 
104
#define DICT_TABLE_IDS_ID       ut_dulint_create(0, 5)
109
105
 
110
106
#define DICT_HDR_FIRST_ID       10      /* the ids for tables etc. start
111
107
                                        from this number, except for basic
113
109
                                        indexes; ibuf tables and indexes are
114
110
                                        assigned as the id the number
115
111
                                        DICT_IBUF_ID_MIN plus the space id */
116
 
#define DICT_IBUF_ID_MIN        0xFFFFFFFF00000000ULL
 
112
#define DICT_IBUF_ID_MIN        ut_dulint_create(0xFFFFFFFFUL, 0)
117
113
 
118
114
/* The offset of the dictionary header on the page */
119
115
#define DICT_HDR                FSEG_PAGE_DATA
123
119
#define DICT_HDR_ROW_ID         0       /* The latest assigned row id */
124
120
#define DICT_HDR_TABLE_ID       8       /* The latest assigned table id */
125
121
#define DICT_HDR_INDEX_ID       16      /* The latest assigned index id */
126
 
#define DICT_HDR_MAX_SPACE_ID   24      /* The latest assigned space id, or 0*/
127
 
#define DICT_HDR_MIX_ID_LOW     28      /* Obsolete,always DICT_HDR_FIRST_ID */
 
122
#define DICT_HDR_MIX_ID         24      /* Obsolete, always 0. */
128
123
#define DICT_HDR_TABLES         32      /* Root of the table index tree */
129
124
#define DICT_HDR_TABLE_IDS      36      /* Root of the table index tree */
130
125
#define DICT_HDR_COLUMNS        40      /* Root of the column index tree */
142
137
#define DICT_SYS_INDEXES_PAGE_NO_FIELD   8
143
138
#define DICT_SYS_INDEXES_SPACE_NO_FIELD  7
144
139
#define DICT_SYS_INDEXES_TYPE_FIELD      6
145
 
#define DICT_SYS_INDEXES_NAME_FIELD      4
146
140
 
147
141
/* When a row id which is zero modulo this number (which must be a power of
148
142
two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is