summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-02-02 12:54:49 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-02-02 12:54:49 +0100
commitc711ce6726102a2c4872e1bd6918e2a9772b7c2d (patch)
tree28afe03c7912a95367973f279a71006e76e08162 /sql/protocol.cc
parentb503d77d5c07166956374e230333b5095a44586a (diff)
downloadmariadb-git-c711ce6726102a2c4872e1bd6918e2a9772b7c2d.tar.gz
Bug #36022 please log more information about "Sort aborted" queries
Write an additional warning message to the server log, explaining why a sort operation is aborted. The output in mysqld.err will look something like: 110127 15:07:54 [ERROR] mysqld: Sort aborted: Out of memory (Needed 24 bytes) 110127 15:07:54 [ERROR] mysqld: Out of sort memory, consider increasing server sort buffer size 110127 15:07:54 [ERROR] mysqld: Sort aborted: Out of sort memory, consider increasing server sort buffer size 110127 15:07:54 [ERROR] mysqld: Sort aborted: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1 If --log-warn=2 is enabled, we output information about host/user/query as well. include/my_sys.h: Update comment for ME_NOREFRESH mysql-test/include/mtr_warnings.sql: Remove global filtering of "Out of sort memory", let each individual test set it instead. mysql-test/r/filesort_debug.result: New test case. mysql-test/r/order_by.result: Ignore "Out of memory" for this test. mysql-test/t/filesort_debug.test: New test case. mysql-test/t/order_by.test: Ignore "Out of memory" for this test. sql/filesort.cc: Output an explanation using the error message from the THD Diagnostics_area. sql/protocol.cc: Do not DBUG_RETURN(function_call_with DBUG_RETURN) as it messes up the call stack in the debug output. sql/share/errmsg-utf8.txt: Change error message for "Out of sort memory" sql/unireg.h: Remove unused/confusing ERRMAPP macro.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 03b151e4346..c50861d73a0 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -543,9 +543,10 @@ bool Protocol::send_ok(uint server_status, uint statement_warn_count,
const char *message)
{
DBUG_ENTER("Protocol::send_ok");
-
- DBUG_RETURN(net_send_ok(thd, server_status, statement_warn_count,
- affected_rows, last_insert_id, message));
+ const bool retval=
+ net_send_ok(thd, server_status, statement_warn_count,
+ affected_rows, last_insert_id, message);
+ DBUG_RETURN(retval);
}
@@ -558,8 +559,8 @@ bool Protocol::send_ok(uint server_status, uint statement_warn_count,
bool Protocol::send_eof(uint server_status, uint statement_warn_count)
{
DBUG_ENTER("Protocol::send_eof");
-
- DBUG_RETURN(net_send_eof(thd, server_status, statement_warn_count));
+ const bool retval= net_send_eof(thd, server_status, statement_warn_count);
+ DBUG_RETURN(retval);
}
@@ -573,8 +574,8 @@ bool Protocol::send_error(uint sql_errno, const char *err_msg,
const char *sql_state)
{
DBUG_ENTER("Protocol::send_error");
-
- DBUG_RETURN(net_send_error_packet(thd, sql_errno, err_msg, sql_state));
+ const bool retval= net_send_error_packet(thd, sql_errno, err_msg, sql_state);
+ DBUG_RETURN(retval);
}