Commit ff1e0821 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-8073 - Build error in sql/mdl.cc on OS X 10.10

C++03 seem to require default constructor for const objects even though they're
fully initialized. There is defect report for this:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253

Apparently some compilers (e.g. gcc) addressed this defect report, while some
(e.g. clang) did not.

Added empty default constructor to MDL_scoped_lock and MDL_object_lock classes.

Also replaced lf_hash_search_using_hash_value() with lf_hash_search(). The
latter will call mdl_key->hash_value() anyway.
parent 499deca7
...@@ -346,6 +346,7 @@ public: ...@@ -346,6 +346,7 @@ public:
*/ */
struct MDL_scoped_lock : public MDL_lock_strategy struct MDL_scoped_lock : public MDL_lock_strategy
{ {
MDL_scoped_lock() {}
virtual const bitmap_t *incompatible_granted_types_bitmap() const virtual const bitmap_t *incompatible_granted_types_bitmap() const
{ return m_granted_incompatible; } { return m_granted_incompatible; }
virtual const bitmap_t *incompatible_waiting_types_bitmap() const virtual const bitmap_t *incompatible_waiting_types_bitmap() const
...@@ -382,6 +383,7 @@ public: ...@@ -382,6 +383,7 @@ public:
*/ */
struct MDL_object_lock : public MDL_lock_strategy struct MDL_object_lock : public MDL_lock_strategy
{ {
MDL_object_lock() {}
virtual const bitmap_t *incompatible_granted_types_bitmap() const virtual const bitmap_t *incompatible_granted_types_bitmap() const
{ return m_granted_incompatible; } { return m_granted_incompatible; }
virtual const bitmap_t *incompatible_waiting_types_bitmap() const virtual const bitmap_t *incompatible_waiting_types_bitmap() const
...@@ -741,8 +743,8 @@ MDL_lock* MDL_map::find_or_insert(LF_PINS *pins, const MDL_key *mdl_key) ...@@ -741,8 +743,8 @@ MDL_lock* MDL_map::find_or_insert(LF_PINS *pins, const MDL_key *mdl_key)
} }
retry: retry:
while (!(lock= (MDL_lock*) lf_hash_search_using_hash_value(&m_locks, pins, while (!(lock= (MDL_lock*) lf_hash_search(&m_locks, pins, mdl_key->ptr(),
mdl_key->hash_value(), mdl_key->ptr(), mdl_key->length()))) mdl_key->length())))
if (lf_hash_insert(&m_locks, pins, (uchar*) mdl_key) == -1) if (lf_hash_insert(&m_locks, pins, (uchar*) mdl_key) == -1)
return NULL; return NULL;
...@@ -780,9 +782,7 @@ MDL_map::get_lock_owner(LF_PINS *pins, const MDL_key *mdl_key) ...@@ -780,9 +782,7 @@ MDL_map::get_lock_owner(LF_PINS *pins, const MDL_key *mdl_key)
} }
else else
{ {
lock= (MDL_lock*) lf_hash_search_using_hash_value(&m_locks, pins, lock= (MDL_lock*) lf_hash_search(&m_locks, pins, mdl_key->ptr(),
mdl_key->hash_value(),
mdl_key->ptr(),
mdl_key->length()); mdl_key->length());
if (lock) if (lock)
{ {
......
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