00001 /****************************************************** 00002 Loads to the memory cache database object definitions 00003 from dictionary tables 00004 00005 (c) 1996 Innobase Oy 00006 00007 Created 4/24/1996 Heikki Tuuri 00008 *******************************************************/ 00009 00010 #ifndef dict0load_h 00011 #define dict0load_h 00012 00013 #include "univ.i" 00014 #include "dict0types.h" 00015 #include "ut0byte.h" 00016 00017 /************************************************************************ 00018 In a crash recovery we already have all the tablespace objects created. 00019 This function compares the space id information in the InnoDB data dictionary 00020 to what we already read with fil_load_single_table_tablespaces(). 00021 00022 In a normal startup, we create the tablespace objects for every table in 00023 InnoDB's data dictionary, if the corresponding .ibd file exists. 00024 We also scan the biggest space id, and store it to fil_system. */ 00025 00026 void 00027 dict_check_tablespaces_and_store_max_id( 00028 /*====================================*/ 00029 ibool in_crash_recovery); /* in: are we doing a crash recovery */ 00030 /************************************************************************ 00031 Finds the first table name in the given database. */ 00032 00033 char* 00034 dict_get_first_table_name_in_db( 00035 /*============================*/ 00036 /* out, own: table name, NULL if 00037 does not exist; the caller must free 00038 the memory in the string! */ 00039 const char* name); /* in: database name which ends to '/' */ 00040 /************************************************************************ 00041 Loads a table definition and also all its index definitions, and also 00042 the cluster definition if the table is a member in a cluster. Also loads 00043 all foreign key constraints where the foreign key is in the table or where 00044 a foreign key references columns in this table. */ 00045 00046 dict_table_t* 00047 dict_load_table( 00048 /*============*/ 00049 /* out: table, NULL if does not exist; 00050 if the table is stored in an .ibd file, 00051 but the file does not exist, 00052 then we set the ibd_file_missing flag TRUE 00053 in the table object we return */ 00054 const char* name); /* in: table name in the 00055 databasename/tablename format */ 00056 /*************************************************************************** 00057 Loads a table object based on the table id. */ 00058 00059 dict_table_t* 00060 dict_load_table_on_id( 00061 /*==================*/ 00062 /* out: table; NULL if table does not exist */ 00063 dulint table_id); /* in: table id */ 00064 /************************************************************************ 00065 This function is called when the database is booted. 00066 Loads system table index definitions except for the clustered index which 00067 is added to the dictionary cache at booting before calling this function. */ 00068 00069 void 00070 dict_load_sys_table( 00071 /*================*/ 00072 dict_table_t* table); /* in: system table */ 00073 /*************************************************************************** 00074 Loads foreign key constraints where the table is either the foreign key 00075 holder or where the table is referenced by a foreign key. Adds these 00076 constraints to the data dictionary. Note that we know that the dictionary 00077 cache already contains all constraints where the other relevant table is 00078 already in the dictionary cache. */ 00079 00080 ulint 00081 dict_load_foreigns( 00082 /*===============*/ 00083 /* out: DB_SUCCESS or error code */ 00084 const char* table_name, /* in: table name */ 00085 ibool check_charsets);/* in: TRUE=check charsets 00086 compatibility */ 00087 /************************************************************************ 00088 Prints to the standard output information on all tables found in the data 00089 dictionary system table. */ 00090 00091 void 00092 dict_print(void); 00093 /*============*/ 00094 00095 00096 #ifndef UNIV_NONINL 00097 #include "dict0load.ic" 00098 #endif 00099 00100 #endif
1.4.7

