Skip to content

Commit 6976bb9

Browse files
nayuta-yanagisawavuvova
authored andcommitted
MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
Add missing DBUG_RETURN to my_malloc.
1 parent 8d714db commit 6976bb9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

mysql-test/main/query_cache.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,12 @@ Variable_name Value
22072207
Qcache_queries_in_cache 0
22082208
DROP FUNCTION foo;
22092209
drop table t1;
2210+
#
2211+
# MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
2212+
#
2213+
set global Query_cache_size=18446744073709547520;
2214+
Warnings:
2215+
Warning 1282 Query cache failed to set size 18446744073709547520; new query cache size is 0
22102216
restore defaults
22112217
SET GLOBAL query_cache_type= default;
22122218
SET GLOBAL query_cache_size=@save_query_cache_size;

mysql-test/main/query_cache.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,11 @@ show status like "Qcache_queries_in_cache";
18001800
DROP FUNCTION foo;
18011801
drop table t1;
18021802

1803+
--echo #
1804+
--echo # MDEV-24858 SIGABRT in DbugExit from my_malloc in Query_cache::init_cache Regression
1805+
--echo #
1806+
set global Query_cache_size=18446744073709547520;
1807+
18031808
--echo restore defaults
18041809
SET GLOBAL query_cache_type= default;
18051810
SET GLOBAL query_cache_size=@save_query_cache_size;

mysys/my_malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void *my_malloc(PSI_memory_key key, size_t size, myf my_flags)
7979
if (!size)
8080
size=1;
8181
if (size > SIZE_T_MAX - 1024L*1024L*16L) /* Wrong call */
82-
return 0;
82+
DBUG_RETURN(0);
8383

8484
/* We have to align size as we store MY_THREAD_SPECIFIC flag in the LSB */
8585
size= ALIGN_SIZE(size);

0 commit comments

Comments
 (0)