Commit be39bccc authored by Sergey Petrunya's avatar Sergey Petrunya

Alternative fix for failure in filesort_debug.test.

- Make THD::raise_condition() call push_warning() after set_error_status() call.
  (they seem to have accidentally exchanged in this merge cset:
   sergii@pisem.net-20130721143919-7cltcw2l9g29f983)
- Rollback the patch from two csets before (the one with comment:
   Update filesort_debug.test (see comment #1 in MDEV-4786 for analysis))
parent c451c87f
...@@ -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