#include "dict0mem.h"#include "rem0rec.h"#include "data0type.h"#include "mach0data.h"#include "dict0dict.h"#include "que0que.h"#include "pars0pars.h"#include "lock0lock.h"Include dependency graph for dict0mem.c:

Go to the source code of this file.
Defines | |
| #define | DICT_HEAP_SIZE 100 |
Functions | |
| dict_table_t * | dict_mem_table_create (const char *name, ulint space, ulint n_cols, ulint flags) |
| void | dict_mem_table_free (dict_table_t *table) |
| void | dict_mem_table_add_col (dict_table_t *table, const char *name, ulint mtype, ulint prtype, ulint len, ulint prec) |
| dict_index_t * | dict_mem_index_create (const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields) |
| dict_foreign_t * | dict_mem_foreign_create (void) |
| void | dict_mem_index_add_field (dict_index_t *index, const char *name, ulint prefix_len) |
| void | dict_mem_index_free (dict_index_t *index) |
| #define DICT_HEAP_SIZE 100 |
Definition at line 23 of file dict0mem.c.
| dict_foreign_t* dict_mem_foreign_create | ( | void | ) |
Definition at line 195 of file dict0mem.c.
References dict_foreign_struct::foreign_col_names, dict_foreign_struct::foreign_index, dict_foreign_struct::foreign_table, dict_foreign_struct::foreign_table_name, dict_foreign_struct::heap, dict_foreign_struct::id, mem_heap_alloc(), mem_heap_create, dict_foreign_struct::n_fields, NULL, dict_foreign_struct::referenced_col_names, dict_foreign_struct::referenced_index, dict_foreign_struct::referenced_table, dict_foreign_struct::referenced_table_name, and dict_foreign_struct::type.
Referenced by dict_create_foreign_constraints_low(), and dict_load_foreign().
00197 : foreign constraint struct */ 00198 { 00199 dict_foreign_t* foreign; 00200 mem_heap_t* heap; 00201 00202 heap = mem_heap_create(100); 00203 00204 foreign = mem_heap_alloc(heap, sizeof(dict_foreign_t)); 00205 00206 foreign->heap = heap; 00207 00208 foreign->id = NULL; 00209 00210 foreign->type = 0; 00211 foreign->foreign_table_name = NULL; 00212 foreign->foreign_table = NULL; 00213 foreign->foreign_col_names = NULL; 00214 00215 foreign->referenced_table_name = NULL; 00216 foreign->referenced_table = NULL; 00217 foreign->referenced_col_names = NULL; 00218 00219 foreign->n_fields = 0; 00220 00221 foreign->foreign_index = NULL; 00222 foreign->referenced_index = NULL; 00223 00224 return(foreign); 00225 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dict_mem_index_add_field | ( | dict_index_t * | index, | |
| const char * | name, | |||
| ulint | prefix_len | |||
| ) |
Definition at line 233 of file dict0mem.c.
References dict_index_get_nth_field(), DICT_INDEX_MAGIC_N, index(), dict_field_struct::name, dict_field_struct::prefix_len, and ut_ad.
Referenced by dict_boot(), dict_index_add_col(), dict_load_fields(), ibuf_data_init_for_space(), and pars_create_index().
00235 : index */ 00236 const char* name, /* in: column name */ 00237 ulint prefix_len) /* in: 0 or the column prefix length 00238 in a MySQL index like 00239 INDEX (textcol(25)) */ 00240 { 00241 dict_field_t* field; 00242 00243 ut_ad(index && name); 00244 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); 00245 00246 index->n_def++; 00247 00248 field = dict_index_get_nth_field(index, index->n_def - 1); 00249 00250 field->name = name; 00251 field->prefix_len = prefix_len; 00252 }
Here is the call graph for this function:

Here is the caller graph for this function:

| dict_index_t* dict_mem_index_create | ( | const char * | table_name, | |
| const char * | index_name, | |||
| ulint | space, | |||
| ulint | type, | |||
| ulint | n_fields | |||
| ) |
Definition at line 150 of file dict0mem.c.
References DICT_HEAP_SIZE, DICT_INDEX_MAGIC_N, FALSE, index(), mem_heap_alloc(), mem_heap_create, mem_heap_strdup(), NULL, and ut_ad.
Referenced by dict_boot(), dict_index_build_internal_clust(), dict_index_build_internal_non_clust(), dict_load_indexes(), ibuf_data_init_for_space(), ibuf_dummy_index_create(), mlog_parse_index(), pars_create_index(), and srv_init().
00152 : index object */ 00153 const char* table_name, /* in: table name */ 00154 const char* index_name, /* in: index name */ 00155 ulint space, /* in: space where the index tree is 00156 placed, ignored if the index is of 00157 the clustered type */ 00158 ulint type, /* in: DICT_UNIQUE, 00159 DICT_CLUSTERED, ... ORed */ 00160 ulint n_fields) /* in: number of fields */ 00161 { 00162 dict_index_t* index; 00163 mem_heap_t* heap; 00164 00165 ut_ad(table_name && index_name); 00166 00167 heap = mem_heap_create(DICT_HEAP_SIZE); 00168 index = mem_heap_alloc(heap, sizeof(dict_index_t)); 00169 00170 index->heap = heap; 00171 00172 index->type = type; 00173 index->space = space; 00174 index->name = mem_heap_strdup(heap, index_name); 00175 index->table_name = table_name; 00176 index->table = NULL; 00177 index->n_def = index->n_nullable = 0; 00178 index->n_fields = n_fields; 00179 index->fields = mem_heap_alloc(heap, 1 + n_fields 00180 * sizeof(dict_field_t)); 00181 /* The '1 +' above prevents allocation 00182 of an empty mem block */ 00183 index->stat_n_diff_key_vals = NULL; 00184 00185 index->cached = FALSE; 00186 index->magic_n = DICT_INDEX_MAGIC_N; 00187 00188 return(index); 00189 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dict_mem_index_free | ( | dict_index_t * | index | ) |
Definition at line 258 of file dict0mem.c.
References DICT_INDEX_MAGIC_N, index(), mem_heap_free, and ut_ad.
Referenced by dict_index_add_to_cache(), dict_index_remove_from_cache(), ibuf_dummy_index_free(), and recv_parse_or_apply_log_rec_body().
00260 : index */ 00261 { 00262 ut_ad(index); 00263 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); 00264 00265 mem_heap_free(index->heap); 00266 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dict_mem_table_add_col | ( | dict_table_t * | table, | |
| const char * | name, | |||
| ulint | mtype, | |||
| ulint | prtype, | |||
| ulint | len, | |||
| ulint | prec | |||
| ) |
Definition at line 115 of file dict0mem.c.
References dict_col_struct::clust_pos, dict_col_get_type(), dict_table_get_nth_col(), DICT_TABLE_MAGIC_N, dtype_set(), dict_table_struct::heap, dict_col_struct::ind, dict_table_struct::magic_n, mem_heap_strdup(), dict_table_struct::n_def, dict_col_struct::name, dict_col_struct::ord_part, dict_col_struct::table, and ut_ad.
Referenced by dict_boot(), dict_load_columns(), dict_table_add_to_cache(), ibuf_data_init_for_space(), ibuf_dummy_index_add_col(), mlog_parse_index(), pars_create_table(), and srv_init().
00117 : table */ 00118 const char* name, /* in: column name */ 00119 ulint mtype, /* in: main datatype */ 00120 ulint prtype, /* in: precise type */ 00121 ulint len, /* in: length */ 00122 ulint prec) /* in: precision */ 00123 { 00124 dict_col_t* col; 00125 dtype_t* type; 00126 00127 ut_ad(table && name); 00128 ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 00129 00130 table->n_def++; 00131 00132 col = dict_table_get_nth_col(table, table->n_def - 1); 00133 00134 col->ind = table->n_def - 1; 00135 col->name = mem_heap_strdup(table->heap, name); 00136 col->table = table; 00137 col->ord_part = 0; 00138 00139 col->clust_pos = ULINT_UNDEFINED; 00140 00141 type = dict_col_get_type(col); 00142 00143 dtype_set(type, mtype, prtype, len, prec); 00144 }
Here is the call graph for this function:

Here is the caller graph for this function:

| dict_table_t* dict_mem_table_create | ( | const char * | name, | |
| ulint | space, | |||
| ulint | n_cols, | |||
| ulint | flags | |||
| ) |
Definition at line 30 of file dict0mem.c.
References dict_table_struct::auto_inc_lock, dict_table_struct::autoinc_inited, dict_table_struct::autoinc_mutex, dict_table_struct::cached, dict_table_struct::cols, DATA_N_SYS_COLS, DICT_HEAP_SIZE, DICT_TABLE_MAGIC_N, DICT_TF_COMPACT, dict_table_struct::dir_path_of_temp_table, dict_table_struct::does_not_fit_in_memory, FALSE, dict_table_struct::flags, dict_table_struct::foreign_list, dict_table_struct::heap, dict_table_struct::ibd_file_missing, dict_table_struct::indexes, lock_get_size(), dict_table_struct::locks, dict_table_struct::magic_n, dict_table_struct::max_row_size, mem_heap_alloc(), mem_heap_create, mem_heap_strdup(), mutex_create, dict_table_struct::n_cols, dict_table_struct::n_def, dict_table_struct::n_foreign_key_checks_running, dict_table_struct::n_mysql_handles_opened, dict_table_struct::name, NULL, dict_table_struct::query_cache_inv_trx_id, dict_table_struct::referenced_list, dict_table_struct::space, dict_table_struct::stat_initialized, dict_table_struct::stat_modified_counter, SYNC_DICT_AUTOINC_MUTEX, dict_table_struct::tablespace_discarded, ut_ad, ut_dulint_zero, and UT_LIST_INIT.
Referenced by dict_boot(), dict_load_table(), ibuf_data_init_for_space(), ibuf_dummy_index_create(), mlog_parse_index(), pars_create_table(), and srv_init().
00032 : table object */ 00033 const char* name, /* in: table name */ 00034 ulint space, /* in: space where the clustered index of 00035 the table is placed; this parameter is 00036 ignored if the table is made a member of 00037 a cluster */ 00038 ulint n_cols, /* in: number of columns */ 00039 ulint flags) /* in: table flags */ 00040 { 00041 dict_table_t* table; 00042 mem_heap_t* heap; 00043 00044 ut_ad(name); 00045 ut_ad(!(flags & ~DICT_TF_COMPACT)); 00046 00047 heap = mem_heap_create(DICT_HEAP_SIZE); 00048 00049 table = mem_heap_alloc(heap, sizeof(dict_table_t)); 00050 00051 table->heap = heap; 00052 00053 table->flags = flags; 00054 table->name = mem_heap_strdup(heap, name); 00055 table->dir_path_of_temp_table = NULL; 00056 table->space = space; 00057 table->ibd_file_missing = FALSE; 00058 table->tablespace_discarded = FALSE; 00059 table->n_def = 0; 00060 table->n_cols = n_cols + DATA_N_SYS_COLS; 00061 00062 table->n_mysql_handles_opened = 0; 00063 table->n_foreign_key_checks_running = 0; 00064 00065 table->cached = FALSE; 00066 00067 table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS) 00068 * sizeof(dict_col_t)); 00069 UT_LIST_INIT(table->indexes); 00070 00071 table->auto_inc_lock = mem_heap_alloc(heap, lock_get_size()); 00072 00073 table->query_cache_inv_trx_id = ut_dulint_zero; 00074 00075 UT_LIST_INIT(table->locks); 00076 UT_LIST_INIT(table->foreign_list); 00077 UT_LIST_INIT(table->referenced_list); 00078 00079 table->does_not_fit_in_memory = FALSE; 00080 00081 table->stat_initialized = FALSE; 00082 00083 table->stat_modified_counter = 0; 00084 00085 table->max_row_size = 0; 00086 00087 mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); 00088 00089 table->autoinc_inited = FALSE; 00090 00091 table->magic_n = DICT_TABLE_MAGIC_N; 00092 00093 return(table); 00094 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dict_mem_table_free | ( | dict_table_t * | table | ) |
Definition at line 100 of file dict0mem.c.
References dict_table_struct::autoinc_mutex, DICT_TABLE_MAGIC_N, dict_table_struct::heap, dict_table_struct::magic_n, mem_heap_free, mutex_free(), and ut_ad.
Referenced by dict_table_remove_from_cache(), ibuf_dummy_index_free(), recv_parse_or_apply_log_rec_body(), row_create_table_for_mysql(), and row_mysql_recover_tmp_table().
00102 : table */ 00103 { 00104 ut_ad(table); 00105 ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 00106 00107 mutex_free(&(table->autoinc_mutex)); 00108 mem_heap_free(table->heap); 00109 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

