diff options
-rw-r--r-- | sql/sql_class.cc | 8 |
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); } |