#include "univ.i"#include "dict0types.h"#include "data0type.h"#include "data0data.h"#include "mem0mem.h"#include "rem0types.h"#include "btr0types.h"#include "ut0mem.h"#include "ut0lst.h"#include "ut0rnd.h"#include "ut0byte.h"#include "sync0rw.h"#include "lock0types.h"#include "hash0hash.h"#include "que0types.h"Include dependency graph for dict0mem.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define DICT_CLUSTERED 1 |
Definition at line 30 of file dict0mem.h.
Referenced by btr_cur_del_mark_set_clust_rec(), btr_cur_ins_lock_and_undo(), btr_cur_optimistic_insert(), btr_cur_upd_lock_and_undo(), btr_cur_update_in_place(), btr_store_big_rec_extern_fields(), dict_boot(), dict_build_index_def_step(), dict_hdr_create(), dict_index_add_to_cache(), dict_index_build_internal_clust(), dict_index_build_internal_non_clust(), dict_index_contains_col_or_prefix(), dict_index_get_nth_col_pos(), dict_load_indexes(), fsp_header_init(), ibuf_data_init_for_space(), ibuf_insert(), ibuf_insert_low(), ibuf_set_free_bits(), ibuf_set_free_bits_low(), lock_clust_rec_cons_read_sees(), lock_clust_rec_modify_check_and_lock(), lock_clust_rec_read_check_and_lock(), lock_rec_convert_impl_to_expl(), lock_rec_insert_check_and_lock(), lock_rec_queue_validate(), lock_sec_rec_cons_read_sees(), lock_sec_rec_modify_check_and_lock(), lock_sec_rec_read_check_and_lock(), lock_sec_rec_some_has_impl_off_kernel(), mlog_parse_index(), opt_calc_index_goodness(), opt_clust_access(), opt_find_all_cols(), opt_search_plan_for_table(), pars_create_index(), pars_update_statement(), row_build(), row_get_clust_rec(), row_get_rec_sys_field(), row_ins_clust_index_entry_by_modify(), row_ins_dupl_error_with_rec(), row_ins_duplicate_error_in_clust(), row_ins_foreign_check_on_constraint(), row_ins_index_entry_low(), row_ins_sec_index_entry_by_modify(), row_ins_set_exclusive_rec_lock(), row_ins_set_shared_rec_lock(), row_search_for_mysql(), row_sel(), row_sel_fetch_columns(), row_sel_try_search_shortcut(), row_sel_try_search_shortcut_for_mysql(), row_set_rec_sys_field(), row_unlock_for_mysql(), row_upd_build_difference_binary(), row_upd_build_sec_rec_difference_binary(), row_upd_clust_rec(), row_upd_clust_rec_by_insert(), row_upd_del_mark_clust_rec(), row_upd_index_entry_sys_field(), row_upd_sec_step(), row_upd_write_sys_vals_to_log(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), sel_set_rec_lock(), trx_undo_page_report_modify(), trx_undo_prev_version_build(), trx_undo_rec_get_row_ref(), trx_undo_rec_skip_row_ref(), trx_undo_report_row_operation(), and trx_undo_update_rec_get_update().
| #define DICT_FOREIGN_ON_DELETE_CASCADE 1 |
Definition at line 267 of file dict0mem.h.
Referenced by dict_create_foreign_constraints_low(), dict_print_info_on_foreign_key_in_create_format(), dict_print_info_on_foreign_keys(), and row_ins_foreign_check_on_constraint().
| #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16 |
Definition at line 271 of file dict0mem.h.
Referenced by dict_create_foreign_constraints_low(), dict_print_info_on_foreign_key_in_create_format(), and dict_print_info_on_foreign_keys().
| #define DICT_FOREIGN_ON_DELETE_SET_NULL 2 |
Definition at line 268 of file dict0mem.h.
Referenced by dict_print_info_on_foreign_key_in_create_format(), dict_print_info_on_foreign_keys(), and row_ins_foreign_check_on_constraint().
| #define DICT_FOREIGN_ON_UPDATE_CASCADE 4 |
Definition at line 269 of file dict0mem.h.
Referenced by dict_create_foreign_constraints_low(), dict_print_info_on_foreign_key_in_create_format(), dict_print_info_on_foreign_keys(), and row_ins_foreign_check_on_constraint().
| #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32 |
Definition at line 272 of file dict0mem.h.
Referenced by dict_create_foreign_constraints_low(), dict_print_info_on_foreign_key_in_create_format(), and dict_print_info_on_foreign_keys().
| #define DICT_FOREIGN_ON_UPDATE_SET_NULL 8 |
Definition at line 270 of file dict0mem.h.
Referenced by dict_print_info_on_foreign_key_in_create_format(), dict_print_info_on_foreign_keys(), and row_ins_foreign_check_on_constraint().
| #define DICT_IBUF 8 |
Definition at line 34 of file dict0mem.h.
Referenced by btr_create(), btr_cur_ins_lock_and_undo(), btr_cur_search_to_nth_level(), btr_page_alloc(), btr_page_free_low(), btr_search_info_update_hash(), dict_index_build_internal_clust(), fsp_header_init(), and ibuf_data_init_for_space().
| #define DICT_INDEX_MAGIC_N 76789786 |
Definition at line 275 of file dict0mem.h.
Referenced by dict_index_add_to_cache(), dict_index_contains_col_or_prefix(), dict_index_get_nth_col_pos(), dict_index_get_nth_field_pos(), dict_index_remove_from_cache(), dict_mem_index_add_field(), dict_mem_index_create(), and dict_mem_index_free().
| #define DICT_MAX_INDEX_COL_LEN 768 |
Definition at line 144 of file dict0mem.h.
Referenced by dict_index_add_col(), dtuple_convert_big_rec(), and row_create_index_for_mysql().
| #define DICT_TABLE_MAGIC_N 76333786 |
Definition at line 396 of file dict0mem.h.
Referenced by dict_col_add_to_cache(), dict_col_remove_from_cache(), dict_col_reposition_in_cache(), dict_index_build_internal_clust(), dict_index_build_internal_non_clust(), dict_index_find_cols(), dict_index_remove_from_cache(), dict_mem_table_add_col(), dict_mem_table_create(), dict_mem_table_free(), dict_table_add_to_cache(), dict_table_change_id_in_cache(), and dict_table_remove_from_cache().
| #define DICT_TABLE_ORDINARY 1 |
Definition at line 37 of file dict0mem.h.
Referenced by dict_create_sys_tables_tuple(), and dict_load_table().
| #define DICT_TF_COMPACT 1 |
Definition at line 45 of file dict0mem.h.
Referenced by dict_create_sys_tables_tuple(), dict_load_table(), dict_mem_table_create(), ibuf_dummy_index_create(), mlog_parse_index(), and srv_init().
| #define DICT_TREE_MAGIC_N 7545676 |
| #define DICT_UNIQUE 2 |
Definition at line 31 of file dict0mem.h.
Referenced by dict_boot(), dict_hdr_create(), dict_index_build_internal_clust(), pars_create_index(), row_ins_alloc_row_id_step(), row_ins_duplicate_error_in_clust(), row_ins_index_entry_low(), row_scan_and_check_index(), and row_search_for_mysql().
| #define DICT_UNIVERSAL 4 |
Definition at line 32 of file dict0mem.h.
Referenced by btr_index_rec_validate(), cmp_rec_rec_with_match(), dict_index_add_to_cache(), dict_index_build_internal_clust(), dict_index_build_internal_non_clust(), dict_index_copy_types(), dict_tree_build_node_ptr(), dict_tree_copy_rec_order_prefix(), fsp_header_init(), ibuf_data_init_for_space(), and row_build_index_entry().
| 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

