summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2010-10-11 11:59:43 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2010-10-11 11:59:43 +0300
commit734a7327686c16a8f8b4063aef7d0e8bdc638e89 (patch)
tree462cc04d9c23d49d4d989a7ec4d51c86cee8a3dd /storage
parent2cc30ff2f169a823a81a0f1565c3b25b7888d980 (diff)
downloadmariadb-git-734a7327686c16a8f8b4063aef7d0e8bdc638e89.tar.gz
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.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0mysql.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 3e155fd14e6..20885f4098c 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -1938,15 +1938,13 @@ err_exit:
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);
@@ -1961,9 +1959,13 @@ err_exit:
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;
}