~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/dict/dict0boot.c

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file dict/dict0boot.c
20
21
Data dictionary creation and booting
21
22
 
22
23
Created 4/18/1996 Heikki Tuuri
39
40
#include "log0recv.h"
40
41
#include "os0file.h"
41
42
 
42
 
/**************************************************************************
43
 
Gets a pointer to the dictionary header and x-latches its page. */
 
43
/**********************************************************************//**
 
44
Gets a pointer to the dictionary header and x-latches its page.
 
45
@return pointer to the dictionary header, page x-latched */
44
46
UNIV_INTERN
45
47
dict_hdr_t*
46
48
dict_hdr_get(
47
49
/*=========*/
48
 
                        /* out: pointer to the dictionary header,
49
 
                        page x-latched */
50
 
        mtr_t*  mtr)    /* in: mtr */
 
50
        mtr_t*  mtr)    /*!< in: mtr */
51
51
{
52
52
        buf_block_t*    block;
53
53
        dict_hdr_t*     header;
61
61
        return(header);
62
62
}
63
63
 
64
 
/**************************************************************************
65
 
Returns a new table, index, or tree id. */
 
64
/**********************************************************************//**
 
65
Returns a new table, index, or tree id.
 
66
@return the new id */
66
67
UNIV_INTERN
67
68
dulint
68
69
dict_hdr_get_new_id(
69
70
/*================*/
70
 
                        /* out: the new id */
71
 
        ulint   type)   /* in: DICT_HDR_ROW_ID, ... */
 
71
        ulint   type)   /*!< in: DICT_HDR_ROW_ID, ... */
72
72
{
73
73
        dict_hdr_t*     dict_hdr;
74
74
        dulint          id;
90
90
        return(id);
91
91
}
92
92
 
93
 
/**************************************************************************
 
93
/**********************************************************************//**
94
94
Writes the current value of the row id counter to the dictionary header file
95
95
page. */
96
96
UNIV_INTERN
115
115
        mtr_commit(&mtr);
116
116
}
117
117
 
118
 
/*********************************************************************
 
118
/*****************************************************************//**
119
119
Creates the file page for the dictionary header. This function is
120
 
called only at the database creation. */
 
120
called only at the database creation.
 
121
@return TRUE if succeed */
121
122
static
122
123
ibool
123
124
dict_hdr_create(
124
125
/*============*/
125
 
                        /* out: TRUE if succeed */
126
 
        mtr_t*  mtr)    /* in: mtr */
 
126
        mtr_t*  mtr)    /*!< in: mtr */
127
127
{
128
128
        buf_block_t*    block;
129
129
        dict_hdr_t*     dict_header;
161
161
        /*--------------------------*/
162
162
        root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
163
163
                                  DICT_HDR_SPACE, 0, DICT_TABLES_ID,
164
 
                                  srv_sys->dummy_ind1, mtr);
 
164
                                  dict_ind_redundant, mtr);
165
165
        if (root_page_no == FIL_NULL) {
166
166
 
167
167
                return(FALSE);
172
172
        /*--------------------------*/
173
173
        root_page_no = btr_create(DICT_UNIQUE, DICT_HDR_SPACE, 0,
174
174
                                  DICT_TABLE_IDS_ID,
175
 
                                  srv_sys->dummy_ind1, mtr);
 
175
                                  dict_ind_redundant, mtr);
176
176
        if (root_page_no == FIL_NULL) {
177
177
 
178
178
                return(FALSE);
183
183
        /*--------------------------*/
184
184
        root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
185
185
                                  DICT_HDR_SPACE, 0, DICT_COLUMNS_ID,
186
 
                                  srv_sys->dummy_ind1, mtr);
 
186
                                  dict_ind_redundant, mtr);
187
187
        if (root_page_no == FIL_NULL) {
188
188
 
189
189
                return(FALSE);
194
194
        /*--------------------------*/
195
195
        root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
196
196
                                  DICT_HDR_SPACE, 0, DICT_INDEXES_ID,
197
 
                                  srv_sys->dummy_ind1, mtr);
 
197
                                  dict_ind_redundant, mtr);
198
198
        if (root_page_no == FIL_NULL) {
199
199
 
200
200
                return(FALSE);
205
205
        /*--------------------------*/
206
206
        root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
207
207
                                  DICT_HDR_SPACE, 0, DICT_FIELDS_ID,
208
 
                                  srv_sys->dummy_ind1, mtr);
 
208
                                  dict_ind_redundant, mtr);
209
209
        if (root_page_no == FIL_NULL) {
210
210
 
211
211
                return(FALSE);
218
218
        return(TRUE);
219
219
}
220
220
 
221
 
/*********************************************************************
 
221
/*****************************************************************//**
222
222
Initializes the data dictionary memory structures when the database is
223
223
started. This function is also called when the data dictionary is created. */
224
224
UNIV_INTERN
430
430
        mutex_exit(&(dict_sys->mutex));
431
431
}
432
432
 
433
 
/*********************************************************************
 
433
/*****************************************************************//**
434
434
Inserts the basic system table data into themselves in the database
435
435
creation. */
436
436
static
441
441
        /* Does nothing yet */
442
442
}
443
443
 
444
 
/*********************************************************************
 
444
/*****************************************************************//**
445
445
Creates and initializes the data dictionary at the database creation. */
446
446
UNIV_INTERN
447
447
void