diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index 6f21fb4b931..f17931ae919 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -303,7 +303,6 @@ bool Sql_cmd_alter_table::execute(THD *thd) create_info.data_file_name= create_info.index_file_name= NULL; thd->enable_slow_log= opt_log_slow_admin_statements; - thd->work_part_info= 0; #ifdef WITH_WSREP TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b2b2bfb5a27..89b5adff60c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3315,7 +3315,6 @@ mysql_execute_command(THD *thd) create_info.add(DDL_options_st::OPT_OR_REPLACE_SLAVE_GENERATED); } - thd->work_part_info= 0; #ifdef WITH_PARTITION_STORAGE_ENGINE { partition_info *part_info= thd->lex->part_info; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9637702d836..3c9146354d6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6060,7 +6060,6 @@ remove_key: } } - DBUG_ASSERT(thd->work_part_info == 0); #ifdef WITH_PARTITION_STORAGE_ENGINE partition_info *tab_part_info= table->part_info; thd->work_part_info= thd->lex->part_info; @@ -8415,8 +8414,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { DBUG_ENTER("mysql_alter_table"); - thd->work_part_info= 0; // Used by partitioning - /* Check if we attempt to alter mysql.slow_log or mysql.general_log table and return an error if diff --git a/sql/table.cc b/sql/table.cc index f6a27b1b1b3..4407d631db8 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2233,7 +2233,9 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, goto ret; thd->lex->create_info.db_type= hton; +#ifdef WITH_PARTITION_STORAGE_ENGINE thd->work_part_info= 0; // For partitioning +#endif if (tabledef_version.str) thd->lex->create_info.tabledef_version= tabledef_version;