Skip to content

Commit

Permalink
After-merge fixes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed May 30, 2018
1 parent 00677b3 commit c0f9771
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/btr/btr0sea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/include/btr0sea.ic
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
24 changes: 12 additions & 12 deletions unittest/sql/mf_iocache-t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c0f9771

Please sign in to comment.