From c0f977105820dcc9daadf268181561dca9de4483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 30 May 2018 10:02:43 +0300 Subject: [PATCH] After-merge fixes Fix type mismatches in the unit test mdev10259(). btr_search_info_get_ref_count(): Do not return early if !table->space. We can simply access table->space_id even after the tablespace has been discarded. btr_get_search_latch(): Relax a debug assertion to allow !index->table->space. --- storage/innobase/btr/btr0sea.cc | 2 +- storage/innobase/include/btr0sea.ic | 3 ++- unittest/sql/mf_iocache-t.cc | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index ca4d2e91979ec..038e262cfadeb 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -431,7 +431,7 @@ btr_search_info_get_ref_count( { ulint ret = 0; - if (!btr_search_enabled || !index->table->space) { + if (!btr_search_enabled) { return(ret); } diff --git a/storage/innobase/include/btr0sea.ic b/storage/innobase/include/btr0sea.ic index c99cb2d8d0672..efa3667d229db 100644 --- a/storage/innobase/include/btr0sea.ic +++ b/storage/innobase/include/btr0sea.ic @@ -152,7 +152,8 @@ static inline bool btr_search_own_any(ulint mode) static inline rw_lock_t* btr_get_search_latch(const dict_index_t* index) { ut_ad(index != NULL); - ut_ad(index->table->space->id == index->table->space_id); + ut_ad(!index->table->space + || index->table->space->id == index->table->space_id); ulint ifold = ut_fold_ulint_pair(ulint(index->id), index->table->space_id); diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index b94b4ef090556..dbb16e51c7043 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -213,14 +213,14 @@ void mdev10259() res= reinit_io_cache(&info, READ_CACHE, 0, 0, 0); ok(res == 0, "reinit READ_CACHE" INFO_TAIL); - res= my_b_fill(&info); - ok(res == 200, "fill" INFO_TAIL); + size_t s= my_b_fill(&info); + ok(s == 200, "fill" INFO_TAIL); - res= my_b_fill(&info); - ok(res == 0, "fill" INFO_TAIL); + s= my_b_fill(&info); + ok(s == 0, "fill" INFO_TAIL); - res= my_b_fill(&info); - ok(res == 0, "fill" INFO_TAIL); + s= my_b_fill(&info); + ok(s == 0, "fill" INFO_TAIL); res= reinit_io_cache(&info, WRITE_CACHE, saved_pos, 0, 0); ok(res == 0, "reinit WRITE_CACHE" INFO_TAIL); @@ -230,14 +230,14 @@ void mdev10259() ok(200 == my_b_bytes_in_cache(&info),"my_b_bytes_in_cache == 200"); - res= my_b_fill(&info); - ok(res == 0, "fill" INFO_TAIL); + s= my_b_fill(&info); + ok(s == 0, "fill" INFO_TAIL); - res= my_b_fill(&info); - ok(res == 0, "fill" INFO_TAIL); + s= my_b_fill(&info); + ok(s == 0, "fill" INFO_TAIL); - res= my_b_fill(&info); - ok(res == 0, "fill" INFO_TAIL); + s= my_b_fill(&info); + ok(s == 0, "fill" INFO_TAIL); res= reinit_io_cache(&info, WRITE_CACHE, saved_pos, 0, 0); ok(res == 0, "reinit WRITE_CACHE" INFO_TAIL);