~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
/******************************************************
2
Loads to the memory cache database object definitions
3
from dictionary tables
4
5
(c) 1996 Innobase Oy
6
7
Created 4/24/1996 Heikki Tuuri
8
*******************************************************/
9
10
#ifndef dict0load_h
11
#define dict0load_h
12
13
#include "univ.i"
14
#include "dict0types.h"
15
#include "ut0byte.h"
16
17
/************************************************************************
18
In a crash recovery we already have all the tablespace objects created.
19
This function compares the space id information in the InnoDB data dictionary
20
to what we already read with fil_load_single_table_tablespaces().
21
22
In a normal startup, we create the tablespace objects for every table in
23
InnoDB's data dictionary, if the corresponding .ibd file exists.
24
We also scan the biggest space id, and store it to fil_system. */
25
26
void
27
dict_check_tablespaces_and_store_max_id(
28
/*====================================*/
29
	ibool	in_crash_recovery);	/* in: are we doing a crash recovery */
30
/************************************************************************
31
Finds the first table name in the given database. */
32
33
char*
34
dict_get_first_table_name_in_db(
35
/*============================*/
36
				/* out, own: table name, NULL if
37
				does not exist; the caller must free
38
				the memory in the string! */
39
	const char*	name);	/* in: database name which ends to '/' */
40
/************************************************************************
41
Loads a table definition and also all its index definitions, and also
42
the cluster definition if the table is a member in a cluster. Also loads
43
all foreign key constraints where the foreign key is in the table or where
44
a foreign key references columns in this table. */
45
46
dict_table_t*
47
dict_load_table(
48
/*============*/
49
				/* out: table, NULL if does not exist;
50
				if the table is stored in an .ibd file,
51
				but the file does not exist,
52
				then we set the ibd_file_missing flag TRUE
53
				in the table object we return */
54
	const char*	name);	/* in: table name in the
55
				databasename/tablename format */
56
/***************************************************************************
57
Loads a table object based on the table id. */
58
59
dict_table_t*
60
dict_load_table_on_id(
61
/*==================*/
62
				/* out: table; NULL if table does not exist */
63
	dulint	table_id);	/* in: table id */
64
/************************************************************************
65
This function is called when the database is booted.
66
Loads system table index definitions except for the clustered index which
67
is added to the dictionary cache at booting before calling this function. */
68
69
void
70
dict_load_sys_table(
71
/*================*/
72
	dict_table_t*	table);	/* in: system table */
73
/***************************************************************************
74
Loads foreign key constraints where the table is either the foreign key
75
holder or where the table is referenced by a foreign key. Adds these
76
constraints to the data dictionary. Note that we know that the dictionary
77
cache already contains all constraints where the other relevant table is
78
already in the dictionary cache. */
79
80
ulint
81
dict_load_foreigns(
82
/*===============*/
83
					/* out: DB_SUCCESS or error code */
84
	const char*	table_name,	/* in: table name */
85
	ibool		check_charsets);/* in: TRUE=check charsets
86
					compatibility */
87
/************************************************************************
88
Prints to the standard output information on all tables found in the data
89
dictionary system table. */
90
91
void
92
dict_print(void);
93
/*============*/
94
95
96
#ifndef UNIV_NONINL
97
#include "dict0load.ic"
98
#endif
99
100
#endif