Skip to content

Commit

Permalink
MDEV-16615 ASAN SEGV in handler::print_error or server crash after er…
Browse files Browse the repository at this point in the history
…ror upon CREATE TABLE

table->in_use is not always set and a KILL signal can arrive anytime.
  • Loading branch information
vuvova committed Jun 28, 2018
1 parent 8ca1829 commit 45cabf1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions mysql-test/r/max_statement_time.result
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@ ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
set max_statement_time = 0;
drop procedure pr;
drop table t1;
SET max_statement_time= 1;
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
8 changes: 8 additions & 0 deletions mysql-test/t/max_statement_time.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/not_valgrind.inc

--echo
Expand Down Expand Up @@ -226,3 +227,10 @@ call pr();
set max_statement_time = 0;
drop procedure pr;
drop table t1;

#
# MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE
#
SET max_statement_time= 1;
--error ER_STATEMENT_TIMEOUT
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;
4 changes: 2 additions & 2 deletions sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3413,8 +3413,8 @@ void handler::print_error(int error, myf errflag)
break;
case HA_ERR_ABORTED_BY_USER:
{
DBUG_ASSERT(table->in_use->killed);
table->in_use->send_kill_message();
DBUG_ASSERT(ha_thd()->killed);
ha_thd()->send_kill_message();
DBUG_VOID_RETURN;
}
case HA_ERR_WRONG_MRG_TABLE_DEF:
Expand Down

0 comments on commit 45cabf1

Please sign in to comment.