45#define DICT_HEAP_SIZE 100
50UNIV_INTERN mysql_pfs_key_t autoinc_mutex_key;
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);
86 table->cols =
static_cast<dict_col_t *
>(
mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
87 *
sizeof(dict_col_t)));
92 mutex_create(autoinc_mutex_key,
93 &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
99 table->n_waiting_or_granted_auto_inc_locks = 0;
102 ut_d(table->magic_n = DICT_TABLE_MAGIC_N);
115 ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
116 ut_d(table->cached = FALSE);
118#ifndef UNIV_HOTBACKUP
119 mutex_free(&(table->autoinc_mutex));
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);
177dict_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)) {
202 table->col_names = s;
205 table->col_names = dict_add_col_name(table->col_names,
209 col = dict_table_get_nth_col(table, i);
211 dict_mem_fill_column_struct(col, i, mtype, prtype, len);
220dict_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
250dict_mem_index_create(
252 const char* table_name,
253 const char* index_name,
264 ut_ad(table_name && index_name);
267 index =
static_cast<dict_index_t *
>(
mem_heap_zalloc(heap,
sizeof(dict_index_t)));
270 space, type, n_fields);
283 dict_foreign_t* foreign;
288 foreign =
static_cast<dict_foreign_t *
>(
mem_heap_zalloc(heap,
sizeof(dict_foreign_t)));
290 foreign->
heap = heap;
302dict_mem_foreign_table_name_lookup_set(
304 dict_foreign_t* foreign,
307 if (srv_lower_case_table_names == 2) {
329dict_mem_referenced_table_name_lookup_set(
331 dict_foreign_t* foreign,
334 if (srv_lower_case_table_names == 2) {
355dict_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);
UNIV_INLINE void dtype_get_mblen(ulint mtype, ulint prtype, ulint *mbminlen, ulint *mbmaxlen)
UNIV_INLINE void dict_col_set_mbminmaxlen(dict_col_t *col, ulint mbminlen, ulint mbmaxlen)
UNIV_INLINE void dict_mem_fill_index_struct(dict_index_t *index, mem_heap_t *heap, const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
UNIV_INTERN dict_foreign_t * dict_mem_foreign_create(void)
UNIV_INTERN void innobase_casedn_str(char *a)
UNIV_INTERN ulint lock_get_size(void)
#define mem_heap_create(N)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_free(heap)
UNIV_INLINE void * mem_heap_zalloc(mem_heap_t *heap, ulint n)
char * referenced_table_name
char * foreign_table_name_lookup
char * foreign_table_name
char * referenced_table_name_lookup
UNIV_INTERN void ut_free(void *ptr)
UNIV_INTERN void * ut_malloc(ulint n)
UNIV_INTERN void rbt_free(ib_rbt_t *tree)