Commit c6838cc6 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-17726 Assertion `sqlcom != SQLCOM_TRUNCATE' failed in...

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.
parent 7e756437
/*
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment