diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-15 17:52:57 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-15 17:52:57 +0200 |
commit | c6838cc646dde24a2a5518a3c07ef210c84f787a (patch) | |
tree | 1cfa1d6a6e90325f066cee8131b8acddd0b2751e /sql/temporary_tables.cc | |
parent | 7e756437789d61aa751592a7444316d116e677e0 (diff) | |
download | mariadb-git-c6838cc646dde24a2a5518a3c07ef210c84f787a.tar.gz |
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.
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 3201b306fad..574ed96ada8 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -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. |