diff options
Diffstat (limited to 'storage/innobase/dict/dict0mem.c')
-rw-r--r-- | storage/innobase/dict/dict0mem.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c index eec35310039..d9f0ad3d84e 100644 --- a/storage/innobase/dict/dict0mem.c +++ b/storage/innobase/dict/dict0mem.c @@ -36,13 +36,13 @@ dict_mem_table_create( ignored if the table is made a member of a cluster */ ulint n_cols, /* in: number of columns */ - ibool comp) /* in: TRUE=compact page format */ + ulint flags) /* in: table flags */ { dict_table_t* table; mem_heap_t* heap; - + ut_ad(name); - ut_ad(comp == FALSE || comp == TRUE); + ut_ad(!(flags & ~DICT_TF_COMPACT)); heap = mem_heap_create(DICT_HEAP_SIZE); @@ -51,24 +51,24 @@ dict_mem_table_create( table->heap = heap; table->type = DICT_TABLE_ORDINARY; + table->flags = flags; table->name = mem_heap_strdup(heap, name); table->dir_path_of_temp_table = NULL; table->space = space; table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; - table->comp = comp; table->n_def = 0; table->n_cols = n_cols + DATA_N_SYS_COLS; table->mem_fix = 0; table->n_mysql_handles_opened = 0; table->n_foreign_key_checks_running = 0; - + table->cached = FALSE; - + table->mix_id = ut_dulint_zero; table->mix_len = 0; - + table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS) * sizeof(dict_col_t)); UT_LIST_INIT(table->indexes); @@ -86,14 +86,14 @@ dict_mem_table_create( table->stat_initialized = FALSE; table->stat_modified_counter = 0; - + mutex_create(&(table->autoinc_mutex)); mutex_set_level(&(table->autoinc_mutex), SYNC_DICT_AUTOINC_MUTEX); table->autoinc_inited = FALSE; table->magic_n = DICT_TABLE_MAGIC_N; - + return(table); } @@ -114,7 +114,7 @@ dict_mem_cluster_create( dict_table_t* cluster; /* Clustered tables cannot work with the compact record format. */ - cluster = dict_mem_table_create(name, space, n_cols, FALSE); + cluster = dict_mem_table_create(name, space, n_cols, 0); cluster->type = DICT_TABLE_CLUSTER; cluster->mix_len = mix_len; @@ -150,13 +150,13 @@ dict_mem_table_add_col( { dict_col_t* col; dtype_t* type; - + ut_ad(table && name); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - + table->n_def++; - col = dict_table_get_nth_col(table, table->n_def - 1); + col = dict_table_get_nth_col(table, table->n_def - 1); col->ind = table->n_def - 1; col->name = mem_heap_strdup(table->heap, name); @@ -164,7 +164,7 @@ dict_mem_table_add_col( col->ord_part = 0; col->clust_pos = ULINT_UNDEFINED; - + type = dict_col_get_type(col); dtype_set(type, mtype, prtype, len, prec); @@ -188,14 +188,14 @@ dict_mem_index_create( { dict_index_t* index; mem_heap_t* heap; - + ut_ad(table_name && index_name); heap = mem_heap_create(DICT_HEAP_SIZE); index = mem_heap_alloc(heap, sizeof(dict_index_t)); index->heap = heap; - + index->type = type; index->space = space; index->name = mem_heap_strdup(heap, index_name); @@ -261,24 +261,20 @@ dict_mem_index_add_field( /*=====================*/ dict_index_t* index, /* in: index */ const char* name, /* in: column name */ - ulint order, /* in: order criterion; 0 means an - ascending order */ ulint prefix_len) /* in: 0 or the column prefix length in a MySQL index like INDEX (textcol(25)) */ { dict_field_t* field; - + ut_ad(index && name); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - + index->n_def++; - field = dict_index_get_nth_field(index, index->n_def - 1); + field = dict_index_get_nth_field(index, index->n_def - 1); field->name = name; - field->order = order; - field->prefix_len = prefix_len; } |