Commit 2e13a4c6 authored by Sergey Petrunya's avatar Sergey Petrunya

Automatic merge

parents a31a3716 be39bccc
...@@ -7,7 +7,7 @@ INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5); ...@@ -7,7 +7,7 @@ INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
SET session debug_dbug= '+d,alloc_sort_buffer_fail'; SET session debug_dbug= '+d,alloc_sort_buffer_fail';
CALL mtr.add_suppression("Out of sort memory"); CALL mtr.add_suppression("Out of sort memory");
SELECT * FROM t1 ORDER BY f1 ASC, f0; SELECT * FROM t1 ORDER BY f1 ASC, f0;
Got one of the listed errors ERROR HY001: Out of sort memory, consider increasing server sort buffer size
SET session debug_dbug= @old_debug; SET session debug_dbug= @old_debug;
CREATE FUNCTION f1() RETURNS INT RETURN 1; CREATE FUNCTION f1() RETURNS INT RETURN 1;
DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1; DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
......
...@@ -13,7 +13,7 @@ INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5); ...@@ -13,7 +13,7 @@ INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
SET session debug_dbug= '+d,alloc_sort_buffer_fail'; SET session debug_dbug= '+d,alloc_sort_buffer_fail';
CALL mtr.add_suppression("Out of sort memory"); CALL mtr.add_suppression("Out of sort memory");
--error ER_OUT_OF_SORTMEMORY,ER_OUT_OF_RESOURCES --error ER_OUT_OF_SORTMEMORY
SELECT * FROM t1 ORDER BY f1 ASC, f0; SELECT * FROM t1 ORDER BY f1 ASC, f0;
SET session debug_dbug= @old_debug; SET session debug_dbug= @old_debug;
......
...@@ -1202,18 +1202,6 @@ Sql_condition* THD::raise_condition(uint sql_errno, ...@@ -1202,18 +1202,6 @@ Sql_condition* THD::raise_condition(uint sql_errno,
if (handle_condition(sql_errno, sqlstate, level, msg, &cond)) if (handle_condition(sql_errno, sqlstate, level, msg, &cond))
DBUG_RETURN(cond); DBUG_RETURN(cond);
/*
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 (!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
sql_errno == ER_OUTOFMEMORY)))
{
cond= da->push_warning(this, sql_errno, sqlstate, level, msg);
}
if (level == Sql_condition::WARN_LEVEL_ERROR) if (level == Sql_condition::WARN_LEVEL_ERROR)
{ {
is_slave_error= 1; // needed to catch query errors during replication is_slave_error= 1; // needed to catch query errors during replication
...@@ -1227,6 +1215,16 @@ Sql_condition* THD::raise_condition(uint sql_errno, ...@@ -1227,6 +1215,16 @@ Sql_condition* THD::raise_condition(uint sql_errno,
query_cache_abort(&query_cache_tls); query_cache_abort(&query_cache_tls);
/*
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 (!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
sql_errno == ER_OUTOFMEMORY)))
{
cond= da->push_warning(this, sql_errno, sqlstate, level, msg);
}
DBUG_RETURN(cond); DBUG_RETURN(cond);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment