diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-15 21:02:10 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-15 21:02:10 +0300 |
commit | 7da351d8047087fc589f2f6cdd49b0b3647043f5 (patch) | |
tree | 36e1b92815569210d10bf397bb10839c3b2fa347 /storage | |
parent | 2aed566d2267a824158025c09830bc6353ec88a9 (diff) | |
parent | a9adfc0f68f0741f8d924eb5ba7fa440aad69213 (diff) | |
download | mariadb-git-7da351d8047087fc589f2f6cdd49b0b3647043f5.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 7 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 22 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/bugfix/disabled.def | 1 |
3 files changed, 27 insertions, 3 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index f33091ace3e..4ee0554a03c 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2651,6 +2651,13 @@ tablespace_check: ? fil_space_read_crypt_data(fil_space_t::zip_size(flags), first_page) : NULL; + + if (crypt_data && !crypt_data->is_key_found()) { + crypt_data->~fil_space_crypt_t(); + ut_free(crypt_data); + return FIL_LOAD_INVALID; + } + space = fil_space_t::create( space_id, flags, FIL_TYPE_TABLESPACE, crypt_data); diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index eea28a69392..49331fcbe49 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -779,11 +779,18 @@ processed: @param flags FSP_SPACE_FLAGS @param crypt_data encryption metadata @param size tablespace size in pages - @return tablespace */ + @return tablespace + @retval nullptr if crypt_data is invalid */ static fil_space_t *create(const recv_spaces_t::const_iterator &it, const std::string &name, uint32_t flags, fil_space_crypt_t *crypt_data, uint32_t size) { + if (crypt_data && !crypt_data->is_key_found()) + { + crypt_data->~fil_space_crypt_t(); + ut_free(crypt_data); + return nullptr; + } fil_space_t *space= fil_space_t::create(it->first, flags, FIL_TYPE_TABLESPACE, crypt_data); ut_ad(space); @@ -828,6 +835,9 @@ processed: fil_space_read_crypt_data(fil_space_t::zip_size(flags), page), size); + if (!space) + goto next_item; + space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); fil_node_t *node= UT_LIST_GET_FIRST(space->chain); @@ -838,7 +848,8 @@ free_space: goto next_item; } if (os_file_write(IORequestWrite, node->name, node->handle, - page, 0, fil_space_t::physical_size(flags)) != DB_SUCCESS) + page, 0, fil_space_t::physical_size(flags)) != + DB_SUCCESS) { space->release(); goto free_space; @@ -898,6 +909,11 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p, fil_space_read_crypt_data (fil_space_t::zip_size(flags), page), size); + if (!space) + { + block->page.lock.x_unlock(); + goto fail; + } space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); block->page.lock.x_unlock(); @@ -1363,7 +1379,7 @@ inline void recv_sys_t::clear() mysql_mutex_assert_owner(&mutex); apply_log_recs= false; apply_batch_on= false; - ut_ad(!after_apply || !UT_LIST_GET_LAST(blocks)); + ut_ad(!after_apply || found_corrupt_fs || !UT_LIST_GET_LAST(blocks)); pages.clear(); for (buf_block_t *block= UT_LIST_GET_LAST(blocks); block; ) diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def index e19ea07b76b..68de2b6bfde 100644 --- a/storage/spider/mysql-test/spider/bugfix/disabled.def +++ b/storage/spider/mysql-test/spider/bugfix/disabled.def @@ -1 +1,2 @@ wait_timeout : MDEV-26045 +mdev_27239 : failed with ASAN build |