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
@file include/dict0load.h
21
Loads to the memory cache database object definitions
22
from dictionary tables
24
Created 4/24/1996 Heikki Tuuri
25
*******************************************************/
31
#include "dict0types.h"
35
/********************************************************************//**
36
In a crash recovery we already have all the tablespace objects created.
37
This function compares the space id information in the InnoDB data dictionary
38
to what we already read with fil_load_single_table_tablespaces().
40
In a normal startup, we create the tablespace objects for every table in
41
InnoDB's data dictionary, if the corresponding .ibd file exists.
42
We also scan the biggest space id, and store it to fil_system. */
45
dict_check_tablespaces_and_store_max_id(
46
/*====================================*/
47
ibool in_crash_recovery); /*!< in: are we doing a crash recovery */
48
/********************************************************************//**
49
Finds the first table name in the given database.
50
@return own: table name, NULL if does not exist; the caller must free
51
the memory in the string! */
54
dict_get_first_table_name_in_db(
55
/*============================*/
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.
62
@return table, NULL if does not exist; if the table is stored in an
63
.ibd file, but the file does not exist, then we set the
64
ibd_file_missing flag TRUE in the table object we return */
69
const char* name); /*!< in: table name in the
70
databasename/tablename format */
71
/***********************************************************************//**
72
Loads a table object based on the table id.
73
@return table; NULL if table does not exist */
76
dict_load_table_on_id(
77
/*==================*/
78
dulint table_id); /*!< in: table id */
79
/********************************************************************//**
80
This function is called when the database is booted.
81
Loads system table index definitions except for the clustered index which
82
is added to the dictionary cache at booting before calling this function. */
87
dict_table_t* table); /*!< in: system table */
88
/***********************************************************************//**
89
Loads foreign key constraints where the table is either the foreign key
90
holder or where the table is referenced by a foreign key. Adds these
91
constraints to the data dictionary. Note that we know that the dictionary
92
cache already contains all constraints where the other relevant table is
93
already in the dictionary cache.
94
@return DB_SUCCESS or error code */
99
const char* table_name, /*!< in: table name */
100
ibool check_charsets);/*!< in: TRUE=check charsets
102
/********************************************************************//**
103
Prints to the standard output information on all tables found in the data
104
dictionary system table. */
112
#include "dict0load.ic"