Skip to content

Commit c0f9771

Browse files
committed
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.
1 parent 00677b3 commit c0f9771

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

storage/innobase/btr/btr0sea.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ btr_search_info_get_ref_count(
431431
{
432432
ulint ret = 0;
433433

434-
if (!btr_search_enabled || !index->table->space) {
434+
if (!btr_search_enabled) {
435435
return(ret);
436436
}
437437

storage/innobase/include/btr0sea.ic

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ static inline bool btr_search_own_any(ulint mode)
152152
static inline rw_lock_t* btr_get_search_latch(const dict_index_t* index)
153153
{
154154
ut_ad(index != NULL);
155-
ut_ad(index->table->space->id == index->table->space_id);
155+
ut_ad(!index->table->space
156+
|| index->table->space->id == index->table->space_id);
156157

157158
ulint ifold = ut_fold_ulint_pair(ulint(index->id),
158159
index->table->space_id);

unittest/sql/mf_iocache-t.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@ void mdev10259()
213213
res= reinit_io_cache(&info, READ_CACHE, 0, 0, 0);
214214
ok(res == 0, "reinit READ_CACHE" INFO_TAIL);
215215

216-
res= my_b_fill(&info);
217-
ok(res == 200, "fill" INFO_TAIL);
216+
size_t s= my_b_fill(&info);
217+
ok(s == 200, "fill" INFO_TAIL);
218218

219-
res= my_b_fill(&info);
220-
ok(res == 0, "fill" INFO_TAIL);
219+
s= my_b_fill(&info);
220+
ok(s == 0, "fill" INFO_TAIL);
221221

222-
res= my_b_fill(&info);
223-
ok(res == 0, "fill" INFO_TAIL);
222+
s= my_b_fill(&info);
223+
ok(s == 0, "fill" INFO_TAIL);
224224

225225
res= reinit_io_cache(&info, WRITE_CACHE, saved_pos, 0, 0);
226226
ok(res == 0, "reinit WRITE_CACHE" INFO_TAIL);
@@ -230,14 +230,14 @@ void mdev10259()
230230

231231
ok(200 == my_b_bytes_in_cache(&info),"my_b_bytes_in_cache == 200");
232232

233-
res= my_b_fill(&info);
234-
ok(res == 0, "fill" INFO_TAIL);
233+
s= my_b_fill(&info);
234+
ok(s == 0, "fill" INFO_TAIL);
235235

236-
res= my_b_fill(&info);
237-
ok(res == 0, "fill" INFO_TAIL);
236+
s= my_b_fill(&info);
237+
ok(s == 0, "fill" INFO_TAIL);
238238

239-
res= my_b_fill(&info);
240-
ok(res == 0, "fill" INFO_TAIL);
239+
s= my_b_fill(&info);
240+
ok(s == 0, "fill" INFO_TAIL);
241241

242242
res= reinit_io_cache(&info, WRITE_CACHE, saved_pos, 0, 0);
243243
ok(res == 0, "reinit WRITE_CACHE" INFO_TAIL);

0 commit comments

Comments
 (0)