summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0merge.c
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2010-06-23 10:17:21 +0300
committerVasil Dimov <vasil.dimov@oracle.com>2010-06-23 10:17:21 +0300
commit3ca1a91eb05be75fb06b6ffcd7aa2b557ac9a8e9 (patch)
tree44598cfb41218c9ffee6ecb6be7b6503e06200ba /storage/innobase/row/row0merge.c
parentfdafbdfb863005b45bd12b7c6e3998a6ec6f908a (diff)
downloadmariadb-git-3ca1a91eb05be75fb06b6ffcd7aa2b557ac9a8e9.tar.gz
Merge Bug#47991 fix from mysql-5.1-innodb
------------------------------------------------------------ revno: 3517 revision-id: vasil.dimov@oracle.com-20100622163043-dc0lxy0byg74viet parent: marko.makela@oracle.com-20100621095148-8g73k8k68dpj080u committer: Vasil Dimov <vasil.dimov@oracle.com> branch nick: mysql-5.1-innodb timestamp: Tue 2010-06-22 19:30:43 +0300 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) ------------------------------------------------------------
Diffstat (limited to 'storage/innobase/row/row0merge.c')
-rw-r--r--storage/innobase/row/row0merge.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
index d9084bb4ffd..aab13742532 100644
--- a/storage/innobase/row/row0merge.c
+++ b/storage/innobase/row/row0merge.c
@@ -2357,7 +2357,7 @@ row_merge_rename_tables(
{
ulint err = DB_ERROR;
pars_info_t* info;
- const char* old_name= old_table->name;
+ char old_name[MAX_TABLE_NAME_LEN + 1];
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_ad(old_table != new_table);
@@ -2365,6 +2365,17 @@ row_merge_rename_tables(
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
+ /* store the old/current name to an automatic variable */
+ if (strlen(old_table->name) + 1 <= sizeof(old_name)) {
+ memcpy(old_name, old_table->name, strlen(old_table->name) + 1);
+ } else {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, "InnoDB: too long table name: '%s', "
+ "max length is %d\n", old_table->name,
+ MAX_TABLE_NAME_LEN);
+ ut_error;
+ }
+
trx->op_info = "renaming tables";
/* We use the private SQL parser of Innobase to generate the query