MDEV-17726 Assertion `sqlcom != SQLCOM_TRUNCATE' failed in ha_innobase::delete_table after truncating temporary table

THD::close_temporary_tables(): Assign lex->sql_command so that
the debug assertion will not fail in ha_innobase::delete_table().

Alternatively, we could ensure that thd_killed() holds inside
ha_innobase::delete_table().

There should be no impact for the non-debug build. The thd_sql_command()
inside ha_innobase::delete_table() only affects the treatment of
persistent FOREIGN KEY metadata. There is no persistent metadata
nor foreign key constraints for temporary tables.

No test case was added, because the failure is nondeterministic.
This commit is contained in:
Marko Mäkelä 2018-11-15 17:52:57 +02:00
parent 7e75643778
commit c6838cc646

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2016 MariaDB Corporation
Copyright (c) 2016,2018 MariaDB Corporation
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
@ -476,6 +476,7 @@ bool THD::close_temporary_tables()
}
DBUG_ASSERT(!rgi_slave);
lex->sql_command = SQLCOM_DROP_TABLE;
/*
Ensure we don't have open HANDLERs for tables we are about to close.