~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2008-11-21 16:06:07 UTC
  • mto: This revision was merged to the branch mainline in revision 593.
  • Revision ID: stewart@flamingspork.com-20081121160607-n6gdlt013spuo54r
remove mysql_frm_type
and fix engines to return correct value from delete_table when table doesn't exist.
(it should be ENOENT).

Also fix up some tests that manipulated frm files by hand. These tests are no longer valid and will need to be rewritten in the not too distant future.

Show diffs side-by-side

added added

removed removed

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