Skip to content

Commit 7337680

Browse files
committed
Bug#35200385 The parallel tablespace scan in 8.0 doesn't work as expected [postfix]
Mysql 8.0 is built using C++17. Avoid using unordered_map::contains, as that is a C++20 library feature. Use count instead. Change-Id: I74f3c0d50db438847dfcdf23a5bff109c51809b7
1 parent 742fd15 commit 7337680

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9820,17 +9820,17 @@ bool Fil_system::lookup_for_recovery(space_id_t space_id) {
98209820
because get_scanned_filename_by_space_id has not found it. But it
98219821
could not be a known space_id now, it would mean something went
98229822
quite wrong. */
9823-
ut_a(!recv_sys->missing_ids.contains(space_id));
9823+
ut_a(recv_sys->missing_ids.count(space_id) == 0);
98249824

98259825
/* Every time a space_id is marked deleted, the path
98269826
is also removed from m_dirs. */
9827-
ut_a(!recv_sys->deleted.contains(space_id));
9827+
ut_a(recv_sys->deleted.count(space_id) == 0);
98289828
} else {
98299829
/* Should belong to exactly one of `deleted` or `missing_ids`, as whenever
98309830
adding to deleted we remove from missing_ids, and
98319831
we add to missing_ids only if it's not in deleted. */
9832-
if (recv_sys->deleted.contains(space_id)) {
9833-
ut_a(!recv_sys->missing_ids.contains(space_id));
9832+
if (recv_sys->deleted.count(space_id) != 0) {
9833+
ut_a(recv_sys->missing_ids.count(space_id) == 0);
98349834
} else {
98359835
recv_sys->missing_ids.insert(space_id);
98369836
}
@@ -9960,7 +9960,7 @@ Fil_state fil_tablespace_path_equals(space_id_t space_id,
99609960
never reach here with deleted space. We are running in context of threads of
99619961
DD validation. No one is modifying this data in parallel
99629962
so it is safe to read it without mutex protection. */
9963-
ut_a(!recv_sys->deleted.contains(space_id));
9963+
ut_a(recv_sys->deleted.count(space_id) == 0);
99649964

99659965
/* A file with this space_id was found during scanning.
99669966
Validate its location and check if it was moved from where
@@ -10119,7 +10119,7 @@ bool Fil_system::check_missing_tablespaces() {
1011910119
an id into it, we remove it from recv_sys->missing_ids, and we insert into
1012010120
recv_sys->missing_ids only if it's not in recv_sys->deleted.
1012110121
No space id should be present in both containers. */
10122-
ut_a(!recv_sys->deleted.contains(space_id));
10122+
ut_a(recv_sys->deleted.count(space_id) == 0);
1012310123

1012410124
const auto result = get_scanned_filename_by_space_id(space_id).second;
1012510125

0 commit comments

Comments
 (0)