diff options
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index cf5334cd87f..c3250b6e699 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -32,6 +32,7 @@ #include "probes_mysql.h" #include "sql_test.h" // TEST_filesort #include "opt_range.h" // SQL_SELECT +#include "debug_sync.h" /// How to write record_ref. #define WRITE_REF(file,from) \ @@ -123,6 +124,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, Item_subselect *subselect= tab ? tab->containing_subselect() : 0; MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str); + DEBUG_SYNC(thd, "filesort_start"); /* Release InnoDB's adaptive hash index latch (if holding) before @@ -325,12 +327,13 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, } if (error) { - DBUG_ASSERT(thd->is_error()); + int kill_errno= thd->killed_errno(); + DBUG_ASSERT(thd->is_error() || kill_errno); my_printf_error(ER_FILSORT_ABORT, "%s: %s", MYF(ME_ERROR + ME_WAITTANG), ER_THD(thd, ER_FILSORT_ABORT), - thd->stmt_da->message()); + kill_errno ? ER(kill_errno) : thd->stmt_da->message()); if (global_system_variables.log_warnings > 1) { |