29 #include "dict0mem.ic"
38 #ifndef UNIV_HOTBACKUP
41 #ifdef UNIV_BLOB_DEBUG
45 #define DICT_HEAP_SIZE 100
50 UNIV_INTERN mysql_pfs_key_t autoinc_mutex_key;
58 dict_mem_table_create(
80 table->
flags = (
unsigned int) flags;
81 table->
name =
static_cast<char *
>(
ut_malloc(strlen(name) + 1));
82 memcpy(table->
name, name, strlen(name) + 1);
83 table->
space = (
unsigned int) space;
84 table->
n_cols = (
unsigned int) (n_cols + DATA_N_SYS_COLS);
89 #ifndef UNIV_HOTBACKUP
92 mutex_create(autoinc_mutex_key,
102 ut_d(table->magic_n = DICT_TABLE_MAGIC_N);
115 ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
118 #ifndef UNIV_HOTBACKUP
132 const char* col_names,
143 ut_ad(!cols == !col_names);
147 const char* s = col_names;
150 for (i = 0; i < cols; i++) {
154 old_len = s - col_names;
159 new_len = strlen(name) + 1;
160 total_len = old_len + new_len;
165 memcpy(res, col_names, old_len);
168 memcpy(res + old_len, name, new_len);
177 dict_mem_table_add_col(
190 ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
191 ut_ad(!heap == !name);
196 if (UNIV_UNLIKELY(table->
n_def == table->
n_cols)) {
199 if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->
col_names)) {
209 col = dict_table_get_nth_col(table, i);
211 dict_mem_fill_column_struct(col, i, mtype, prtype, len);
220 dict_mem_fill_column_struct(
229 #ifndef UNIV_HOTBACKUP
234 column->
ind = (
unsigned int) col_pos;
236 column->
mtype = (
unsigned int) mtype;
237 column->
prtype = (
unsigned int) prtype;
238 column->
len = (
unsigned int) col_len;
239 #ifndef UNIV_HOTBACKUP
250 dict_mem_index_create(
252 const char* table_name,
253 const char* index_name,
264 ut_ad(table_name && index_name);
270 space, type, n_fields);
280 dict_mem_foreign_create(
void)
290 foreign->
heap = heap;
302 dict_mem_foreign_table_name_lookup_set(
307 if (srv_lower_case_table_names == 2) {
329 dict_mem_referenced_table_name_lookup_set(
334 if (srv_lower_case_table_names == 2) {
355 dict_mem_index_add_field(
366 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
370 field = dict_index_get_nth_field(index, index->
n_def - 1);
373 field->
prefix_len = (
unsigned int) prefix_len;
385 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
386 #ifdef UNIV_BLOB_DEBUG
388 mutex_free(&index->blobs_mutex);