summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-01-15 15:30:26 +0530
committerNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-01-15 15:30:26 +0530
commit62e8f2567778e201164ba9e0195f13dfede56b42 (patch)
treec177ff5163e51c6d1c8953eeb892c7cc47ca220a /sql/sql_partition.cc
parenta44084413cf48b37a6306e3e6ecf624b8696b330 (diff)
downloadmariadb-git-62e8f2567778e201164ba9e0195f13dfede56b42.tar.gz
Bug#11757464:SERVER CRASH IN RECURSIVE CALL WHEN OOM
Analysis: --------- When the server is out of memory, an error is raised to indicate the same. Handling the error requires more memory to be allocated which fails, hence the error handling loops in a recursion and causes the server to crash. Fix: --- a) Prevents pushing the 'out of memory' error condition to the diagnostic area as it requires memory allocation. GET DIAGNOSTICS, SHOW WARNINGS and SHOW ERRORS statements will not show information about this error. However the 'out of memory' error is returned to the client. b) It sets the ME_FATALERROR flag when 'out of memory' errors are reported (for places where the flag is not already set). This flag prevents activation of SP error handlers which also require memory allocation and therefore are likely to fail.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 066262c3919..8154f4cc404 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -7044,7 +7044,8 @@ void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
void mem_alloc_error(size_t size)
{
- my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(size));
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR),
+ static_cast<int>(size));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE