diff options
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cc5e4197703..342c51d2fe5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1518,6 +1518,7 @@ static void innodb_drop_database(handlerton*, char *path) dfield_set_data(&dfield, namebuf, len); dict_index_copy_types(&tuple, sys_index, 1); std::vector<pfs_os_file_t> to_close; + std::vector<uint32_t> space_ids; mtr_t mtr; mtr.start(); pcur.btr_cur.page_cur.index = sys_index; @@ -1561,6 +1562,7 @@ static void innodb_drop_database(handlerton*, char *path) ut_ad("corrupted SYS_TABLES.SPACE" == 0); else if (uint32_t space_id= mach_read_from_4(s)) { + space_ids.emplace_back(space_id); pfs_os_file_t detached= fil_delete_tablespace(space_id); if (detached != OS_FILE_CLOSED) to_close.emplace_back(detached); @@ -1570,6 +1572,9 @@ static void innodb_drop_database(handlerton*, char *path) mtr.commit(); for (pfs_os_file_t detached : to_close) os_file_close(detached); + for (const auto id : space_ids) + ibuf_delete_for_discarded_space(id); + /* Any changes must be persisted before we return. */ log_write_up_to(mtr.commit_lsn(), true); } |