diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-06-11 16:52:06 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-06-11 16:52:06 +0400 |
commit | 162e426238ed49e175238b1a06072258c2fc666f (patch) | |
tree | dd79682febb582afa1309c3b04f172d140b20aa6 /mysys/safemalloc.c | |
parent | 5bace3f049de457ddbeb3a1946089c0f4c479229 (diff) | |
parent | 779e2a968632a5e73c660307892ca6a868399dfc (diff) | |
download | mariadb-git-162e426238ed49e175238b1a06072258c2fc666f.tar.gz |
Manual merge from the bugfix tree.
conflicts:
conflict sql/sql_parse.cc
Diffstat (limited to 'mysys/safemalloc.c')
-rw-r--r-- | mysys/safemalloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 1235cb5ddd8..2c72026ab5a 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -139,6 +139,11 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) size + /* size requested */ 4 + /* overrun mark */ sf_malloc_endhunc); + DBUG_EXECUTE_IF("simulate_out_of_memory", + { + free(irem); + irem= NULL; + }); } /* Check if there isn't anymore memory avaiable */ if (!irem) @@ -159,6 +164,8 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) } DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", sf_malloc_max_memory,lineno, filename)); + DBUG_EXECUTE_IF("simulate_out_of_memory", + DBUG_SET("-d,simulate_out_of_memory");); if (MyFlags & MY_FAE) exit(1); DBUG_RETURN ((void*) 0); |