From 4e87081b565b66f473f35dcdb02d10b56a5025e7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 9 Aug 2023 20:30:52 +0200 Subject: [PATCH] cleanup: remove useless check create_table_impl() doesn't need to search for a temporary table when the table_name is like #sql-xxx --- sql/sql_table.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 123ececd4bc..173ae9396b0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4457,8 +4457,8 @@ int create_table_impl(THD *thd, If a table exists, it must have been pre-opened. Try looking for one in-use in THD::all_temp_tables list of TABLE_SHAREs. */ - TABLE *tmp_table= thd->find_temporary_table(db.str, table_name.str, - THD::TMP_TABLE_ANY); + TABLE *tmp_table= internal_tmp_table ? NULL : + thd->find_temporary_table(db.str, table_name.str, THD::TMP_TABLE_ANY); if (tmp_table) { @@ -11328,7 +11328,7 @@ end_inplace: thd->is_current_stmt_binlog_format_row() && (create_info->tmp_table()))); - if(start_alter_id) + if (start_alter_id) { if (!is_reg_table) {