summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-09-30 10:14:28 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-10-12 10:01:07 +0200
commit763bdee81b381dda8e676838f5f56c9fbb415ef9 (patch)
tree777c9de6901c190bac041df088fb49def1fb34ec /mysys
parent6cf7d6a0938a9dfe38e38d12384cc8fb86f5d74b (diff)
downloadmariadb-git-763bdee81b381dda8e676838f5f56c9fbb415ef9.tar.gz
MDEV-26637: (explicit length) ASAN: main.metadata and user_variables.basic MTR failures after MDEV-26572
Use explicit length for hash record length
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_mutex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index dd3a5ce132f..aca1c1f7731 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -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)
{