1
/*****************************************************************************
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
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., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/******************************************************
20
Loads to the memory cache database object definitions
21
from dictionary tables
23
Created 4/24/1996 Heikki Tuuri
24
*******************************************************/
30
#include "dict0types.h"
34
/************************************************************************
35
In a crash recovery we already have all the tablespace objects created.
36
This function compares the space id information in the InnoDB data dictionary
37
to what we already read with fil_load_single_table_tablespaces().
39
In a normal startup, we create the tablespace objects for every table in
40
InnoDB's data dictionary, if the corresponding .ibd file exists.
41
We also scan the biggest space id, and store it to fil_system. */
44
dict_check_tablespaces_and_store_max_id(
45
/*====================================*/
46
ibool in_crash_recovery); /* in: are we doing a crash recovery */
47
/************************************************************************
48
Finds the first table name in the given database. */
51
dict_get_first_table_name_in_db(
52
/*============================*/
53
/* out, own: table name, NULL if
54
does not exist; the caller must free
55
the memory in the string! */
56
const char* name); /* in: database name which ends to '/' */
57
/************************************************************************
58
Loads a table definition and also all its index definitions, and also
59
the cluster definition if the table is a member in a cluster. Also loads
60
all foreign key constraints where the foreign key is in the table or where
61
a foreign key references columns in this table. */
66
/* out: table, NULL if does not exist;
67
if the table is stored in an .ibd file,
68
but the file does not exist,
69
then we set the ibd_file_missing flag TRUE
70
in the table object we return */
71
const char* name); /* in: table name in the
72
databasename/tablename format */
73
/***************************************************************************
74
Loads a table object based on the table id. */
77
dict_load_table_on_id(
78
/*==================*/
79
/* out: table; NULL if table does not exist */
80
dulint table_id); /* in: table id */
81
/************************************************************************
82
This function is called when the database is booted.
83
Loads system table index definitions except for the clustered index which
84
is added to the dictionary cache at booting before calling this function. */
89
dict_table_t* table); /* in: system table */
90
/***************************************************************************
91
Loads foreign key constraints where the table is either the foreign key
92
holder or where the table is referenced by a foreign key. Adds these
93
constraints to the data dictionary. Note that we know that the dictionary
94
cache already contains all constraints where the other relevant table is
95
already in the dictionary cache. */
100
/* out: DB_SUCCESS or error code */
101
const char* table_name, /* in: table name */
102
ibool check_charsets);/* in: TRUE=check charsets
104
/************************************************************************
105
Prints to the standard output information on all tables found in the data
106
dictionary system table. */
114
#include "dict0load.ic"