diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2021-02-20 15:13:12 +0000 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-03-01 15:26:21 +0100 |
commit | 6976bb94b4b8247f450418dea6cb9aca97e3554f (patch) | |
tree | 799713203a11ca923fbf611161f280ba19f9c4ca | |
parent | 8d714db622390eff95d25400cd1bd9465d3d0863 (diff) | |
download | mariadb-git-6976bb94b4b8247f450418dea6cb9aca97e3554f.tar.gz |
MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
Add missing DBUG_RETURN to my_malloc.
-rw-r--r-- | mysql-test/main/query_cache.result | 6 | ||||
-rw-r--r-- | mysql-test/main/query_cache.test | 5 | ||||
-rw-r--r-- | mysys/my_malloc.c | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/mysql-test/main/query_cache.result b/mysql-test/main/query_cache.result index fc7ca726c48..43a0ac5f522 100644 --- a/mysql-test/main/query_cache.result +++ b/mysql-test/main/query_cache.result @@ -2207,6 +2207,12 @@ Variable_name Value Qcache_queries_in_cache 0 DROP FUNCTION foo; drop table t1; +# +# MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression +# +set global Query_cache_size=18446744073709547520; +Warnings: +Warning 1282 Query cache failed to set size 18446744073709547520; new query cache size is 0 restore defaults SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_size=@save_query_cache_size; diff --git a/mysql-test/main/query_cache.test b/mysql-test/main/query_cache.test index 6e113f0cdb7..188861cd3d9 100644 --- a/mysql-test/main/query_cache.test +++ b/mysql-test/main/query_cache.test @@ -1800,6 +1800,11 @@ show status like "Qcache_queries_in_cache"; DROP FUNCTION foo; drop table t1; +--echo # +--echo # MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression +--echo # +set global Query_cache_size=18446744073709547520; + --echo restore defaults SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_size=@save_query_cache_size; diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 4f378ba8603..befdcb0e5c3 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -79,7 +79,7 @@ void *my_malloc(PSI_memory_key key, size_t size, myf my_flags) if (!size) size=1; if (size > SIZE_T_MAX - 1024L*1024L*16L) /* Wrong call */ - return 0; + DBUG_RETURN(0); /* We have to align size as we store MY_THREAD_SPECIFIC flag in the LSB */ size= ALIGN_SIZE(size); |