=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug56947.result' --- mysql-test/suite/innodb_plugin/r/innodb_bug56947.result 1970-01-01 00:00:00 +0000 +++ mysql-test/suite/innodb_plugin/r/innodb_bug56947.result revid:marko.makela@oracle.com-20101011081800-sby6kmb8n1mnryfq @@ -0,0 +1,6 @@ +create table bug56947(a int not null) engine = innodb; +CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB; +alter table bug56947 add unique index (a); +ERROR HY000: Table 'test.bug56947#1' already exists +drop table `bug56947#1`; +drop table bug56947; === added file 'mysql-test/suite/innodb_plugin/t/innodb_bug56947.test' --- mysql-test/suite/innodb_plugin/t/innodb_bug56947.test 1970-01-01 00:00:00 +0000 +++ mysql-test/suite/innodb_plugin/t/innodb_bug56947.test revid:marko.makela@oracle.com-20101011081800-sby6kmb8n1mnryfq @@ -0,0 +1,11 @@ +# +# Bug #56947 valgrind reports a memory leak in innodb-plugin.innodb-index +# +-- source include/have_innodb_plugin.inc + +create table bug56947(a int not null) engine = innodb; +CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB; +--error 156 +alter table bug56947 add unique index (a); +drop table `bug56947#1`; +drop table bug56947; === modified file 'storage/innodb_plugin/ChangeLog' --- storage/innodb_plugin/ChangeLog revid:marko.makela@oracle.com-20101011080147-72nory5su5bo9j9k +++ storage/innodb_plugin/ChangeLog revid:marko.makela@oracle.com-20101011081800-sby6kmb8n1mnryfq @@ -1,16 +1,24 @@ +2010-10-11 The InnoDB Team + + * row/row0mysql.c, innodb_bug56947.result, innodb_bug56947.test: + Fix Bug #56947 InnoDB leaks memory when failing to create a table + 2010-10-06 The InnoDB Team + * row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test - Fix Bug #Cascade Delete results in "Got error -1 from storage engine" - + Fix Bug #57255 Cascade Delete results in "Got error -1 from + storage engine" + 2010-09-27 The InnoDB Team * row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test: Fix Bug #56716 InnoDB locks a record gap without locking the table 2010-09-06 The InnoDB Team + * dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery 2010-08-24 The InnoDB Team * handler/ha_innodb.c, dict/dict0dict.c: @@ -37,13 +45,12 @@ 2010-08-01 The InnoDB Team * handler/ha_innodb.cc Fix Bug #55382 Assignment with SELECT expressions takes unexpected S locks in READ COMMITTED ->>>>>>> MERGE-SOURCE 2010-07-27 The InnoDB Team * include/mem0pool.h, mem/mem0mem.c, mem/mem0pool.c, srv/srv0start.c: Fix Bug#55581 shutdown with innodb-use-sys-malloc=0: assert mutex->magic_n == MUTEX_MAGIC_N. === modified file 'storage/innodb_plugin/row/row0mysql.c' --- storage/innodb_plugin/row/row0mysql.c revid:marko.makela@oracle.com-20101011080147-72nory5su5bo9j9k +++ storage/innodb_plugin/row/row0mysql.c revid:marko.makela@oracle.com-20101011081800-sby6kmb8n1mnryfq @@ -1876,21 +1876,19 @@ err_exit: ut_a(thr == que_fork_start_command(que_node_get_parent(thr))); que_run_threads(thr); err = trx->error_state; - if (UNIV_UNLIKELY(err != DB_SUCCESS)) { + switch (err) { + case DB_SUCCESS: + break; + case DB_OUT_OF_FILE_SPACE: trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, NULL); - /* TO DO: free table? The code below will dereference - table->name, though. */ - } - switch (err) { - case DB_OUT_OF_FILE_SPACE: ut_print_timestamp(stderr); fputs(" InnoDB: Warning: cannot create table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs(" because tablespace full\n", stderr); @@ -1899,15 +1897,19 @@ err_exit: row_drop_table_for_mysql(table->name, trx, FALSE); trx_commit_for_mysql(trx); } break; case DB_DUPLICATE_KEY: + default: /* We may also get err == DB_ERROR if the .ibd file for the table already exists */ + trx->error_state = DB_SUCCESS; + trx_general_rollback_for_mysql(trx, NULL); + dict_mem_table_free(table); break; } que_graph_free((que_t*) que_node_get_parent(thr)); trx->op_info = "";