Skip to content

Commit

Permalink
MDEV-7585 Assertion `thd->is_error() || kill_errno || thd->killed == …
Browse files Browse the repository at this point in the history
…ABORT_QUERY' failed in ha_rows filesort

if we clear the error status (in THD::clear_error())
make sure to clear the thd->killed == KILL_BAD_DATA too,
because it was caused by the error that we're clearing.
  • Loading branch information
vuvova committed Apr 27, 2015
1 parent 8e78160 commit 9fd65db
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mysql-test/r/filesort_bad_i_s-7585.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SET sql_mode=STRICT_TRANS_TABLES;
CREATE TABLE t0 (i INT) ENGINE=MyISAM;
CREATE VIEW v1 AS SELECT * FROM t0;
CREATE VIEW v2 AS SELECT * FROM v1;
DROP VIEW IF EXISTS v1;
CREATE TABLE t1 (i INT) ENGINE=MyISAM;
INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS;
DROP VIEW v2;
DROP TABLE t1, t0;
14 changes: 14 additions & 0 deletions mysql-test/t/filesort_bad_i_s-7585.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# MDEV-7585 Assertion `thd->is_error() || kill_errno || thd->killed == ABORT_QUERY' failed in ha_rows filesort
#
SET sql_mode=STRICT_TRANS_TABLES;

CREATE TABLE t0 (i INT) ENGINE=MyISAM;
CREATE VIEW v1 AS SELECT * FROM t0;
CREATE VIEW v2 AS SELECT * FROM v1;
DROP VIEW IF EXISTS v1;

CREATE TABLE t1 (i INT) ENGINE=MyISAM;
INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS;
DROP VIEW v2;
DROP TABLE t1, t0;
2 changes: 2 additions & 0 deletions sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,8 @@ class THD :public Statement,
if (stmt_da->is_error())
stmt_da->reset_diagnostics_area();
is_slave_error= 0;
if (killed == KILL_BAD_DATA)
killed= NOT_KILLED; // KILL_BAD_DATA can be reset w/o a mutex
DBUG_VOID_RETURN;
}
#ifndef EMBEDDED_LIBRARY
Expand Down

0 comments on commit 9fd65db

Please sign in to comment.