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;
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);
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);
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
252 const char* table_name,
253 const char* index_name,
264 ut_ad(table_name && index_name);
270 space, type, n_fields);
290 foreign->
heap = heap;
307 if (srv_lower_case_table_names == 2) {
334 if (srv_lower_case_table_names == 2) {
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_INTERN void dict_mem_index_add_field(dict_index_t *index, const char *name, ulint prefix_len)
char * foreign_table_name_lookup
char * foreign_table_name
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)
char * referenced_table_name_lookup
UNIV_INLINE void dtype_get_mblen(ulint mtype, ulint prtype, ulint *mbminlen, ulint *mbmaxlen)
UNIV_INTERN void * ut_malloc(ulint n)
UNIV_INTERN dict_index_t * dict_mem_index_create(const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
UNIV_INTERN void dict_mem_table_free(dict_table_t *table)
ulong n_waiting_or_granted_auto_inc_locks
#define mem_heap_free(heap)
char * referenced_table_name
UNIV_INTERN void dict_mem_fill_column_struct(dict_col_t *column, ulint col_pos, ulint mtype, ulint prtype, ulint col_len)
UNIV_INTERN dict_table_t * dict_mem_table_create(const char *name, ulint space, ulint n_cols, ulint flags)
UNIV_INLINE void dict_col_set_mbminmaxlen(dict_col_t *col, ulint mbminlen, ulint mbmaxlen)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_create(N)
UNIV_INLINE void * mem_heap_zalloc(mem_heap_t *heap, ulint n)
UNIV_INTERN void dict_mem_table_add_col(dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len)
UNIV_INTERN void dict_mem_foreign_table_name_lookup_set(dict_foreign_t *foreign, ibool do_alloc)
UNIV_INTERN void dict_mem_index_free(dict_index_t *index)
UNIV_INTERN void ut_free(void *ptr)
UNIV_INTERN void innobase_casedn_str(char *a)
UNIV_INTERN dict_foreign_t * dict_mem_foreign_create(void)
UNIV_INTERN void rbt_free(ib_rbt_t *tree)
UNIV_INTERN void dict_mem_referenced_table_name_lookup_set(dict_foreign_t *foreign, ibool do_alloc)
UNIV_INTERN ulint lock_get_size(void)