~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/dict/dict0mem.c

  • Committer: Stewart Smith
  • Author(s): Vasil Dimov
  • Date: 2010-11-17 05:01:55 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1971.
  • Revision ID: stewart@flamingspork.com-20101117050155-yj8coqr9wa9yvhd8
Merge Revision revid:vasil.dimov@oracle.com-20100622163043-dc0lxy0byg74viet from MySQL InnoDB

Original revid:vasil.dimov@oracle.com-20100622163043-dc0lxy0byg74viet

Original Authors: Vasil Dimov <vasil.dimov@oracle.com>
Original commit message:
Fix Bug#47991 InnoDB Dictionary Cache memory usage increases indefinitely
when renaming tables

Allocate the table name using ut_malloc() instead of table->heap because
the latter cannot be freed.

Adjust dict_sys->size calculations all over the code.

Change dict_table_t::name from const char* to char* because we need to
ut_malloc()/ut_free() it.

Reviewed by:    Inaam, Marko, Heikki (rb://384)
Approved by:    Heikki (rb://384)

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        table->heap = heap;
74
74
 
75
75
        table->flags = (unsigned int) flags;
76
 
        table->name = mem_heap_strdup(heap, name);
 
76
        table->name = ut_malloc(strlen(name) + 1);
 
77
        memcpy(table->name, name, strlen(name) + 1);
77
78
        table->space = (unsigned int) space;
78
79
        table->n_cols = (unsigned int) (n_cols + DATA_N_SYS_COLS);
79
80
 
112
113
#ifndef UNIV_HOTBACKUP
113
114
        mutex_free(&(table->autoinc_mutex));
114
115
#endif /* UNIV_HOTBACKUP */
 
116
        ut_free(table->name);
115
117
        mem_heap_free(table->heap);
116
118
}
117
119