summaryrefslogtreecommitdiff
path: root/mysys/safemalloc.c
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 14:51:21 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-11 14:51:21 +0400
commite5cf56ef80391caca2f06b34fc1de1313196e91f (patch)
tree0a5326c23c1d2ab3752bcf621639494ca7c16fc1 /mysys/safemalloc.c
parent0823afc8bf160e03ce722c5e3cef21024b63b99a (diff)
parentc2ebb0ac882feadedd0bbca71277fd2de66aa957 (diff)
downloadmariadb-git-e5cf56ef80391caca2f06b34fc1de1313196e91f.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.c7
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);