Commit 763bdee8 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-26637: (explicit length) ASAN: main.metadata and user_variables.basic MTR...

MDEV-26637: (explicit length) ASAN: main.metadata and user_variables.basic MTR failures after MDEV-26572

Use explicit length for hash record length
parent 6cf7d6a0
......@@ -332,7 +332,8 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
*/
pthread_mutex_lock(&THR_LOCK_mutex);
if (!my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id, 0))
if (!my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id,
sizeof(mp->id)))
{
safe_mutex_deadlock_t *deadlock;
safe_mutex_t *mutex;
......@@ -352,7 +353,8 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
mutex= mutex_root;
do
{
if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id, 0))
if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id,
sizeof(mutex->id)))
{
print_deadlock_warning(mp, mutex);
/* Mark wrong usage to avoid future warnings for same error */
......@@ -772,7 +774,8 @@ static my_bool remove_from_locked_mutex(safe_mutex_t *mp,
delete_mutex->id, mp->id));
found= (safe_mutex_deadlock_t *) my_hash_search(mp->locked_mutex,
(uchar*) &delete_mutex->id, 0);
(uchar*) &delete_mutex->id,
sizeof(delete_mutex->id));
DBUG_ASSERT(found);
if (found)
{
......
......@@ -191,7 +191,7 @@ Host_entry *hostname_cache_first()
static inline Host_entry *hostname_cache_search(const char *ip_key)
{
return hostname_cache->search((uchar *) ip_key, 0);
return hostname_cache->search((uchar *) ip_key, HOST_ENTRY_KEY_SIZE);
}
static void add_hostname_impl(const char *ip_key, const char *hostname,
......
This diff is collapsed.
......@@ -2347,7 +2347,8 @@ rpl_parallel::find(uint32 domain_id)
struct rpl_parallel_entry *e;
if (!(e= (rpl_parallel_entry *)my_hash_search(&domain_hash,
(const uchar *)&domain_id, 0)))
(const uchar *)&domain_id,
sizeof(domain_id))))
{
/* Allocate a new, empty one. */
ulong count= opt_slave_domain_parallel_threads;
......
......@@ -1632,7 +1632,8 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array,
goto end;
}
if ((rec= my_hash_search(hash, (const uchar *)&domain_id, 0)))
if ((rec= my_hash_search(hash, (const uchar *)&domain_id,
sizeof(domain_id))))
{
entry= (struct gtid_pos_element *)rec;
if (entry->sub_id >= sub_id)
......
......@@ -1025,7 +1025,8 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
MARIA_STATE_HISTORY_CLOSED *history;
if ((history= (MARIA_STATE_HISTORY_CLOSED *)
my_hash_search(&maria_stored_state,
(uchar*) &share->state.create_rename_lsn, 0)))
(uchar*) &share->state.create_rename_lsn,
sizeof(share->state.create_rename_lsn))))
{
/*
Move history from hash to share. This is safe to do as we
......
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