~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0merge.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:
2394
2394
{
2395
2395
        ulint           err     = DB_ERROR;
2396
2396
        pars_info_t*    info;
2397
 
        const char*     old_name= old_table->name;
 
2397
        char            old_name[MAX_TABLE_NAME_LEN + 1];
2398
2398
 
2399
2399
        ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
2400
2400
        ut_ad(old_table != new_table);
2402
2402
 
2403
2403
        ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
2404
2404
 
 
2405
        /* store the old/current name to an automatic variable */
 
2406
        if (strlen(old_table->name) + 1 <= sizeof(old_name)) {
 
2407
                memcpy(old_name, old_table->name, strlen(old_table->name) + 1);
 
2408
        } else {
 
2409
                ut_print_timestamp(stderr);
 
2410
                fprintf(stderr, "InnoDB: too long table name: '%s', "
 
2411
                        "max length is %d\n", old_table->name,
 
2412
                        MAX_TABLE_NAME_LEN);
 
2413
                ut_error;
 
2414
        }
 
2415
 
2405
2416
        trx->op_info = "renaming tables";
2406
2417
 
2407
2418
        /* We use the private SQL parser of Innobase to generate the query