summaryrefslogtreecommitdiff
path: root/innobase/dict/dict0mem.c
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
committerunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
commit1065f2bbd66ac4b1161f5c188171a54cbad5b422 (patch)
tree25e3315af05fa92d20d2ad1d812882957c400337 /innobase/dict/dict0mem.c
parent0ba6cb48d84f1ff951d09871a96be6cdef3f2c3c (diff)
parent6366a9090c7fc24f0e13b5b9d73d6777dcda9d9e (diff)
downloadmariadb-git-1065f2bbd66ac4b1161f5c188171a54cbad5b422.tar.gz
Merge with 4.0
innobase/dict/dict0boot.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/dict/dict0mem.c: Auto merged innobase/fut/fut0lst.c: Auto merged innobase/include/buf0lru.h: Auto merged innobase/include/dict0mem.h: Auto merged innobase/include/fsp0fsp.h: Auto merged innobase/include/ha0ha.h: Auto merged innobase/include/ibuf0ibuf.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/log0log.h: Auto merged innobase/include/mem0pool.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/os0file.h: Auto merged innobase/include/rem0rec.h: Auto merged innobase/include/rem0rec.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/include/trx0sys.h: Auto merged innobase/include/ut0byte.h: Auto merged innobase/include/ut0ut.h: Auto merged innobase/mem/mem0pool.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0proc.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0opt.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0purge.c: Auto merged innobase/row/row0uins.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0undo.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/trx/trx0purge.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0undo.c: Auto merged innobase/ut/ut0byte.c: Auto merged pstack/bucomm.h: Auto merged pstack/budbg.h: Auto merged sql/item_sum.h: Auto merged sql/slave.cc: Auto merged sql/sql_db.cc: Auto merged support-files/mysql.spec.sh: Auto merged tests/insert_test.c: Auto merged mysql-test/t/func_group.test: Merge with 4.0 Put 4.1 tests lasts sql/ha_innodb.cc: Merge with 4.0 Added checking of results from my_malloc() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase/dict/dict0mem.c')
-rw-r--r--innobase/dict/dict0mem.c73
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);
-}