summaryrefslogtreecommitdiff
path: root/mysys/my_alloc.c
diff options
context:
space:
mode:
authorunknown <dkatz@damien-katzs-computer.local>2007-04-12 18:03:26 -0400
committerunknown <dkatz@damien-katzs-computer.local>2007-04-12 18:03:26 -0400
commit53f73da2861830769d4f0bb58b1ac1a057cf3cef (patch)
tree0428327013b3dcf9559efa39b3e56193a14dd26d /mysys/my_alloc.c
parent52b86a6e0a9be6f3c41f24b9c30d2b6f885ad94f (diff)
downloadmariadb-git-53f73da2861830769d4f0bb58b1ac1a057cf3cef.tar.gz
Bug #27322 failure to allocate transaction_prealloc_size causes crash
Fix for when memory pre-allocation fails. mysys/my_alloc.c: Added code to null-out the pre-alloc pointer if allocation fails. This is necessary for the next time this procedure is called. mysql-test/r/variables-big.result: Added "big" test for bug fix Bug #27322. mysql-test/t/variables-big.test: Added "big" test for bug fix Bug #27322.
Diffstat (limited to 'mysys/my_alloc.c')
-rw-r--r--mysys/my_alloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index cfa2dd6216d..5983a29a3e1 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -133,6 +133,10 @@ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
mem->next= *prev;
*prev= mem_root->pre_alloc= mem;
}
+ else
+ {
+ mem_root->pre_alloc= 0;
+ }
}
}
else