~drizzle-developers/pkg-libinnodb/karmic

« back to all changes in this revision

Viewing changes to include/dict0load.h

  • Committer: Monty Taylor
  • Date: 2010-02-06 00:11:08 UTC
  • Revision ID: mordred@inaugust.com-20100206001108-qolhr0f4d3tm6pdo
Tags: upstream-1.0.3.5325
ImportĀ upstreamĀ versionĀ 1.0.3.5325

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
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.
 
8
 
 
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.
 
12
 
 
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
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
/******************************************************
 
20
Loads to the memory cache database object definitions
 
21
from dictionary tables
 
22
 
 
23
Created 4/24/1996 Heikki Tuuri
 
24
*******************************************************/
 
25
 
 
26
#ifndef dict0load_h
 
27
#define dict0load_h
 
28
 
 
29
#include "univ.i"
 
30
#include "dict0types.h"
 
31
#include "ut0byte.h"
 
32
#include "mem0mem.h"
 
33
 
 
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().
 
38
 
 
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. */
 
42
UNIV_INTERN
 
43
void
 
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. */
 
49
UNIV_INTERN
 
50
char*
 
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. */
 
62
UNIV_INTERN
 
63
dict_table_t*
 
64
dict_load_table(
 
65
/*============*/
 
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. */
 
75
UNIV_INTERN
 
76
dict_table_t*
 
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. */
 
85
UNIV_INTERN
 
86
void
 
87
dict_load_sys_table(
 
88
/*================*/
 
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. */
 
96
UNIV_INTERN
 
97
ulint
 
98
dict_load_foreigns(
 
99
/*===============*/
 
100
                                        /* out: DB_SUCCESS or error code */
 
101
        const char*     table_name,     /* in: table name */
 
102
        ibool           check_charsets);/* in: TRUE=check charsets
 
103
                                        compatibility */
 
104
/************************************************************************
 
105
Prints to the standard output information on all tables found in the data
 
106
dictionary system table. */
 
107
UNIV_INTERN
 
108
void
 
109
dict_print(void);
 
110
/*============*/
 
111
 
 
112
 
 
113
#ifndef UNIV_NONINL
 
114
#include "dict0load.ic"
 
115
#endif
 
116
 
 
117
#endif