Commit 9df04261 authored by Knut Anders Hatlen's avatar Knut Anders Hatlen Committed by Marko Mäkelä

Bug#25048573: STD::MAP INSTANTIATIONS CAUSE STATIC ASSERT FAILURES ON FREEBSD 11

Problem: Some instantiations of std::map have discrepancies between
the value_type of the map and the value_type of the map's allocator.
On FreeBSD 11 this is detected by Clang, and an error is raised at
compilation time.

Fix: Specify the correct value_type for the allocators.

Also fix an unused variable warning in storage/innobase/os/os0file.cc.
parent 8923f6b7
......@@ -347,7 +347,7 @@ typedef std::map<
const byte*,
buf_chunk_t*,
std::less<const byte*>,
ut_allocator<std::pair<const byte*, buf_chunk_t*> > >
ut_allocator<std::pair<const byte* const, buf_chunk_t*> > >
buf_pool_chunk_map_t;
static buf_pool_chunk_map_t* buf_chunk_map_reg;
......
......@@ -139,7 +139,7 @@ then we would store 5,7,10,11,12 in the array. */
typedef std::vector<ib_uint64_t, ut_allocator<ib_uint64_t> > boundaries_t;
/** Allocator type used for index_map_t. */
typedef ut_allocator<std::pair<const char*, dict_index_t*> >
typedef ut_allocator<std::pair<const char* const, dict_index_t*> >
index_map_t_allocator;
/** Auxiliary map used for sorting indexes by name in dict_stats_save(). */
......
......@@ -130,7 +130,7 @@ struct LatchDebug {
os_thread_id_t,
Latches*,
os_thread_id_less,
ut_allocator<std::pair<const std::string, latch_meta_t> > >
ut_allocator<std::pair<const os_thread_id_t, Latches*> > >
ThreadMap;
/** Constructor */
......@@ -425,7 +425,7 @@ struct LatchDebug {
latch_level_t,
std::string,
latch_level_less,
ut_allocator<std::pair<latch_level_t, std::string> > >
ut_allocator<std::pair<const latch_level_t, std::string> > >
Levels;
/** Mutex protecting the deadlock detector data structures. */
......@@ -1717,7 +1717,7 @@ struct CreateTracker {
const void*,
File,
std::less<const void*>,
ut_allocator<std::pair<const void*, File> > >
ut_allocator<std::pair<const void* const, File> > >
Files;
typedef OSMutex Mutex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment