Skip to content

Commit ff1e082

Browse files
committed
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.
1 parent 499deca commit ff1e082

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sql/mdl.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ class MDL_lock
346346
*/
347347
struct MDL_scoped_lock : public MDL_lock_strategy
348348
{
349+
MDL_scoped_lock() {}
349350
virtual const bitmap_t *incompatible_granted_types_bitmap() const
350351
{ return m_granted_incompatible; }
351352
virtual const bitmap_t *incompatible_waiting_types_bitmap() const
@@ -382,6 +383,7 @@ class MDL_lock
382383
*/
383384
struct MDL_object_lock : public MDL_lock_strategy
384385
{
386+
MDL_object_lock() {}
385387
virtual const bitmap_t *incompatible_granted_types_bitmap() const
386388
{ return m_granted_incompatible; }
387389
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)
741743
}
742744

743745
retry:
744-
while (!(lock= (MDL_lock*) lf_hash_search_using_hash_value(&m_locks, pins,
745-
mdl_key->hash_value(), mdl_key->ptr(), mdl_key->length())))
746+
while (!(lock= (MDL_lock*) lf_hash_search(&m_locks, pins, mdl_key->ptr(),
747+
mdl_key->length())))
746748
if (lf_hash_insert(&m_locks, pins, (uchar*) mdl_key) == -1)
747749
return NULL;
748750

@@ -780,10 +782,8 @@ MDL_map::get_lock_owner(LF_PINS *pins, const MDL_key *mdl_key)
780782
}
781783
else
782784
{
783-
lock= (MDL_lock*) lf_hash_search_using_hash_value(&m_locks, pins,
784-
mdl_key->hash_value(),
785-
mdl_key->ptr(),
786-
mdl_key->length());
785+
lock= (MDL_lock*) lf_hash_search(&m_locks, pins, mdl_key->ptr(),
786+
mdl_key->length());
787787
if (lock)
788788
{
789789
/*

0 commit comments

Comments
 (0)