diff options
Diffstat (limited to 'innobase/dict/dict0mem.c')
-rw-r--r-- | innobase/dict/dict0mem.c | 73 |
1 files changed, 4 insertions, 69 deletions
diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index c49738a0960..a4f83ddd657 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -49,9 +49,7 @@ dict_mem_table_create( table->heap = heap; - str = mem_heap_alloc(heap, 1 + ut_strlen(name)); - - ut_strcpy(str, name); + str = mem_heap_strdup(heap, name); table->type = DICT_TABLE_ORDINARY; table->name = str; @@ -148,7 +146,6 @@ dict_mem_table_add_col( ulint len, /* in: length */ ulint prec) /* in: precision */ { - char* str; dict_col_t* col; dtype_t* type; @@ -156,15 +153,11 @@ dict_mem_table_add_col( ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); table->n_def++; - - col = dict_table_get_nth_col(table, table->n_def - 1); - - str = mem_heap_alloc(table->heap, 1 + ut_strlen(name)); - ut_strcpy(str, name); + col = dict_table_get_nth_col(table, table->n_def - 1); col->ind = table->n_def - 1; - col->name = str; + col->name = mem_heap_strdup(table->heap, name); col->table = table; col->ord_part = 0; @@ -190,7 +183,6 @@ dict_mem_index_create( ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */ ulint n_fields) /* in: number of fields */ { - char* str; dict_index_t* index; mem_heap_t* heap; @@ -201,13 +193,9 @@ dict_mem_index_create( index->heap = heap; - str = mem_heap_alloc(heap, 1 + ut_strlen(index_name)); - - ut_strcpy(str, index_name); - index->type = type; index->space = space; - index->name = str; + index->name = mem_heap_strdup(heap, index_name); index->table_name = table_name; index->table = NULL; index->n_def = 0; @@ -303,56 +291,3 @@ dict_mem_index_free( { mem_heap_free(index->heap); } - -/************************************************************************** -Creates a procedure memory object. */ - -dict_proc_t* -dict_mem_procedure_create( -/*======================*/ - /* out, own: procedure object */ - char* name, /* in: procedure name */ - char* sql_string, /* in: procedure definition as an SQL - string */ - que_fork_t* graph) /* in: parsed procedure graph */ -{ - dict_proc_t* proc; - proc_node_t* proc_node; - mem_heap_t* heap; - char* str; - - ut_ad(name); - - heap = mem_heap_create(128); - - proc = mem_heap_alloc(heap, sizeof(dict_proc_t)); - - proc->heap = heap; - - str = mem_heap_alloc(heap, 1 + ut_strlen(name)); - - ut_strcpy(str, name); - - proc->name = str; - - str = mem_heap_alloc(heap, 1 + ut_strlen(sql_string)); - - ut_strcpy(str, sql_string); - - proc->sql_string = str; - - UT_LIST_INIT(proc->graphs); - -/* UT_LIST_ADD_LAST(graphs, proc->graphs, graph); */ - -#ifdef UNIV_DEBUG - UT_LIST_VALIDATE(graphs, que_t, proc->graphs); -#endif - proc->mem_fix = 0; - - proc_node = que_fork_get_child(graph); - - proc_node->dict_proc = proc; - - return(proc); -} |