Commit 3d90a07a authored by unknown's avatar unknown

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.


mysys/my_malloc.c:
  Pass ME_NOREFRESH flag to an error handler in my_malloc() in case of memory allocation failure, so that it gets logged to the error log.
mysys/safemalloc.c:
  Pass ME_NOREFRESH flag to an error handler in _mymalloc() in case of memory allocation failure, so that it gets logged to the error log.
parent 85c3f6df
...@@ -37,7 +37,7 @@ gptr my_malloc(unsigned int size, myf my_flags) ...@@ -37,7 +37,7 @@ gptr my_malloc(unsigned int size, myf my_flags)
if (my_flags & MY_FAE) if (my_flags & MY_FAE)
error_handler_hook=fatal_error_handler_hook; error_handler_hook=fatal_error_handler_hook;
if (my_flags & (MY_FAE+MY_WME)) if (my_flags & (MY_FAE+MY_WME))
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH),size);
if (my_flags & MY_FAE) if (my_flags & MY_FAE)
exit(1); exit(1);
} }
......
...@@ -150,11 +150,11 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) ...@@ -150,11 +150,11 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
char buff[SC_MAXWIDTH]; char buff[SC_MAXWIDTH];
my_errno=errno; my_errno=errno;
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)", sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)",
size, (size + 1023L) / 1024L, size, (size + 1023L) / 1024L,
sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L); sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L);
my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
} }
DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'",
sf_malloc_max_memory,lineno, filename)); sf_malloc_max_memory,lineno, filename));
......
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