mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Bug #56947 InnoDB leaks memory when failing to create a table
row_create_table_for_mysql(): When the table creation fails, free the dict_table_t object.
This commit is contained in:
parent
df29195345
commit
a8da1a3a58
4 changed files with 35 additions and 9 deletions
6
mysql-test/suite/innodb_plugin/r/innodb_bug56947.result
Normal file
6
mysql-test/suite/innodb_plugin/r/innodb_bug56947.result
Normal file
|
@ -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;
|
11
mysql-test/suite/innodb_plugin/t/innodb_bug56947.test
Normal file
11
mysql-test/suite/innodb_plugin/t/innodb_bug56947.test
Normal file
|
@ -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;
|
|
@ -1,6 +1,13 @@
|
||||||
|
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
|
2010-10-06 The InnoDB Team
|
||||||
|
|
||||||
* row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
|
* 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
|
2010-09-27 The InnoDB Team
|
||||||
|
|
||||||
|
@ -8,6 +15,7 @@
|
||||||
Fix Bug #56716 InnoDB locks a record gap without locking the table
|
Fix Bug #56716 InnoDB locks a record gap without locking the table
|
||||||
|
|
||||||
2010-09-06 The InnoDB Team
|
2010-09-06 The InnoDB Team
|
||||||
|
|
||||||
* dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result
|
* dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result
|
||||||
Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
|
Fix Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
|
||||||
|
|
||||||
|
@ -40,7 +48,6 @@
|
||||||
* handler/ha_innodb.cc
|
* handler/ha_innodb.cc
|
||||||
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
|
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
|
||||||
S locks in READ COMMITTED
|
S locks in READ COMMITTED
|
||||||
>>>>>>> MERGE-SOURCE
|
|
||||||
|
|
||||||
2010-07-27 The InnoDB Team
|
2010-07-27 The InnoDB Team
|
||||||
|
|
||||||
|
|
|
@ -1879,15 +1879,13 @@ err_exit:
|
||||||
|
|
||||||
err = trx->error_state;
|
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->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, NULL);
|
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);
|
ut_print_timestamp(stderr);
|
||||||
fputs(" InnoDB: Warning: cannot create table ",
|
fputs(" InnoDB: Warning: cannot create table ",
|
||||||
stderr);
|
stderr);
|
||||||
|
@ -1902,9 +1900,13 @@ err_exit:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DB_DUPLICATE_KEY:
|
case DB_DUPLICATE_KEY:
|
||||||
|
default:
|
||||||
/* We may also get err == DB_ERROR if the .ibd file for the
|
/* We may also get err == DB_ERROR if the .ibd file for the
|
||||||
table already exists */
|
table already exists */
|
||||||
|
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
|
dict_mem_table_free(table);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue