diff options
-rw-r--r-- | storage/innobase/include/ut0new.h | 5 | ||||
-rw-r--r-- | storage/innobase/ut/ut0new.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/storage/innobase/include/ut0new.h b/storage/innobase/include/ut0new.h index d34954a503c..5137c8f3ae1 100644 --- a/storage/innobase/include/ut0new.h +++ b/storage/innobase/include/ut0new.h @@ -895,12 +895,13 @@ constexpr const char* const auto_event_names[] = "ut0pool", "ut0rbt", "ut0wqueue", - "xtrabackup" + "xtrabackup", + nullptr }; constexpr uint32_t cexpr_lookup_auto_event_name(const char* name, uint32_t idx = 0) { - return idx == UT_ARR_SIZE(auto_event_names) ? INVALID_AUTOEVENT_IDX : + return !auto_event_names[idx] ? INVALID_AUTOEVENT_IDX : cexpr_strequal_ignore_dot(name, auto_event_names[idx]) ? idx : cexpr_lookup_auto_event_name(name, idx + 1); } diff --git a/storage/innobase/ut/ut0new.cc b/storage/innobase/ut/ut0new.cc index 67671348a6e..834386e042e 100644 --- a/storage/innobase/ut/ut0new.cc +++ b/storage/innobase/ut/ut0new.cc @@ -71,14 +71,14 @@ static PSI_memory_info pfs_info[] = { {&mem_key_std, "std", 0}, }; -static const int NKEYS = static_cast<int>UT_ARR_SIZE(auto_event_names); +static const int NKEYS = static_cast<int>UT_ARR_SIZE(auto_event_names)-1; static PSI_memory_key auto_event_keys[NKEYS]; /** Setup the internal objects needed for UT_NEW() to operate. This must be called before the first call to UT_NEW(). */ void ut_new_boot() { - PSI_MEMORY_CALL(register_memory)("innodb", pfs_info, UT_ARR_SIZE(pfs_info)); + PSI_MEMORY_CALL(register_memory)("innodb", pfs_info, static_cast<int>(UT_ARR_SIZE(pfs_info))); static PSI_memory_info pfs_info_auto[NKEYS]; for (int i= 0; i < NKEYS; i++) { |