1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03: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:
Marko Mäkelä
2010-10-11 11:18:00 +03:00
parent df29195345
commit a8da1a3a58
4 changed files with 35 additions and 9 deletions

View File

@ -1879,15 +1879,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);
@ -1902,9 +1900,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;
}