summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-02-01 09:49:27 +0530
committerNisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com>2013-02-01 09:49:27 +0530
commit8fd9e920eb4443b3c6e7648854088b6a1eb07fb4 (patch)
tree270027774a2642ae5946739a9caf414d9b9dc7bc /sql/sql_class.cc
parent4743ba00bbe8e314230a98fba153271816459ba4 (diff)
downloadmariadb-git-8fd9e920eb4443b3c6e7648854088b6a1eb07fb4.tar.gz
BUG#16207679: MISSING ERROR WHEN RESIGNAL TO MYSQL_ERROR=5
Analysis: -------- As part of the fix for Bug#11757464, the 'out of memory' error condition was not pushed to the diagnostic area as it requires memory allocation. However in cases of SIGNAL/RESIGNAL 'out of memory' error, the server may not be out of memory. Hence it would be good to report the error in such cases. Fix: --- Push only non fatal 'out of memory' errors to the diagnostic area. Since SIGNAL/RESIGNAL of 'out of memory' error may not be fatal, the error is reported.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 556e7d66447..effdfc4d6d6 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1137,10 +1137,12 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno,
query_cache_abort(&query_cache_tls);
/*
- Avoid pushing a condition for out of memory errors as this will require
- memory allocation and therefore might fail.
+ Avoid pushing a condition for fatal out of memory errors as this will
+ require memory allocation and therefore might fail. Non fatal out of
+ memory errors can occur if raised by SIGNAL/RESIGNAL statement.
*/
- if (sql_errno != EE_OUTOFMEMORY && sql_errno != ER_OUTOFMEMORY)
+ if (!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
+ sql_errno == ER_OUTOFMEMORY)))
{
cond= warning_info->push_warning(this, sql_errno, sqlstate, level, msg);
}