From 2720e8227b5de5f142def254db320bb9ea7ef47c Mon Sep 17 00:00:00 2001 From: tianfengli Date: Thu, 28 Sep 2023 14:30:01 +0800 Subject: [PATCH] db_type() set incorrectly with small initial tmp_table_size --- sql/sql_tmp_table.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_tmp_table.cc b/sql/sql_tmp_table.cc index 8719426a287..7056ea87a3a 100644 --- a/sql/sql_tmp_table.cc +++ b/sql/sql_tmp_table.cc @@ -2283,8 +2283,11 @@ static bool create_tmp_table_with_fallback(THD *thd, TABLE *table) { table->file->create(share->table_name.str, table, &create_info, nullptr); if (error == HA_ERR_RECORD_FILE_FULL && table->s->db_type() == temptable_hton) { + plugin_unlock(nullptr, table->s->db_plugin); + table->s->db_plugin = ha_lock_engine(nullptr, innodb_hton); table->file = get_new_handler( table->s, false, share->alloc_for_tmp_file_handler, innodb_hton); + assert(table->s->db_type() == innodb_hton); error = table->file->create(share->table_name.str, table, &create_info, nullptr); } -- 2.19.1