~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/dict0load.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

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
@file include/dict0load.h
 
21
Loads to the memory cache database object definitions
 
22
from dictionary tables
 
23
 
 
24
Created 4/24/1996 Heikki Tuuri
 
25
*******************************************************/
 
26
 
 
27
#ifndef dict0load_h
 
28
#define dict0load_h
 
29
 
 
30
#include "univ.i"
 
31
#include "dict0types.h"
 
32
#include "ut0byte.h"
 
33
#include "mem0mem.h"
 
34
 
 
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().
 
39
 
 
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. */
 
43
UNIV_INTERN
 
44
void
 
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! */
 
52
UNIV_INTERN
 
53
char*
 
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 */
 
65
UNIV_INTERN
 
66
dict_table_t*
 
67
dict_load_table(
 
68
/*============*/
 
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 */
 
74
UNIV_INTERN
 
75
dict_table_t*
 
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. */
 
83
UNIV_INTERN
 
84
void
 
85
dict_load_sys_table(
 
86
/*================*/
 
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 */
 
95
UNIV_INTERN
 
96
ulint
 
97
dict_load_foreigns(
 
98
/*===============*/
 
99
        const char*     table_name,     /*!< in: table name */
 
100
        ibool           check_charsets);/*!< in: TRUE=check charsets
 
101
                                        compatibility */
 
102
/********************************************************************//**
 
103
Prints to the standard output information on all tables found in the data
 
104
dictionary system table. */
 
105
UNIV_INTERN
 
106
void
 
107
dict_print(void);
 
108
/*============*/
 
109
 
 
110
 
 
111
#ifndef UNIV_NONINL
 
112
#include "dict0load.ic"
 
113
#endif
 
114
 
 
115
#endif