Skip to content

Commit 729a405

Browse files
author
kaa@polly.local
committed
Fix for bug #26844 "Memory allocation failures ignored by slave IO thread".
Pass ME_NOREFRESH flag to an error handler in my_malloc() and _mymalloc() in case of memory allocation failure, so that it gets logged to the error log.
1 parent b5aeef5 commit 729a405

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mysys/my_malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gptr my_malloc(unsigned int size, myf my_flags)
3737
if (my_flags & MY_FAE)
3838
error_handler_hook=fatal_error_handler_hook;
3939
if (my_flags & (MY_FAE+MY_WME))
40-
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
40+
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH),size);
4141
if (my_flags & MY_FAE)
4242
exit(1);
4343
}

mysys/safemalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
150150
char buff[SC_MAXWIDTH];
151151
my_errno=errno;
152152
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
153-
my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG));
153+
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
154154
sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)",
155155
size, (size + 1023L) / 1024L,
156156
sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L);
157-
my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG));
157+
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
158158
}
159159
DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'",
160160
sf_malloc_max_memory,lineno, filename));

0 commit comments

Comments
 (0)