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< ...@@ -347,7 +347,7 @@ typedef std::map<
const byte*, const byte*,
buf_chunk_t*, buf_chunk_t*,
std::less<const byte*>, 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; buf_pool_chunk_map_t;
static buf_pool_chunk_map_t* buf_chunk_map_reg; 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. */ ...@@ -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; typedef std::vector<ib_uint64_t, ut_allocator<ib_uint64_t> > boundaries_t;
/** Allocator type used for index_map_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; index_map_t_allocator;
/** Auxiliary map used for sorting indexes by name in dict_stats_save(). */ /** Auxiliary map used for sorting indexes by name in dict_stats_save(). */
......
...@@ -130,7 +130,7 @@ struct LatchDebug { ...@@ -130,7 +130,7 @@ struct LatchDebug {
os_thread_id_t, os_thread_id_t,
Latches*, Latches*,
os_thread_id_less, 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; ThreadMap;
/** Constructor */ /** Constructor */
...@@ -425,7 +425,7 @@ struct LatchDebug { ...@@ -425,7 +425,7 @@ struct LatchDebug {
latch_level_t, latch_level_t,
std::string, std::string,
latch_level_less, latch_level_less,
ut_allocator<std::pair<latch_level_t, std::string> > > ut_allocator<std::pair<const latch_level_t, std::string> > >
Levels; Levels;
/** Mutex protecting the deadlock detector data structures. */ /** Mutex protecting the deadlock detector data structures. */
...@@ -1717,7 +1717,7 @@ struct CreateTracker { ...@@ -1717,7 +1717,7 @@ struct CreateTracker {
const void*, const void*,
File, File,
std::less<const void*>, std::less<const void*>,
ut_allocator<std::pair<const void*, File> > > ut_allocator<std::pair<const void* const, File> > >
Files; Files;
typedef OSMutex Mutex; 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