From d8da920264a0321e6d03b3cbe3c3b414f622aefa Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 25 May 2018 11:51:43 +0300 Subject: MDEV-10679 Crash in performance schema and partitioning with discovery Crash happened because in discover, table->work_part_info was not properly reset before execution. Fixed by resetting before calling execute alter table, create table or mysql_create_frm_image. --- sql/sql_table.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 31da585443a..a68f9e626e0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6057,6 +6057,7 @@ 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; @@ -8411,6 +8412,8 @@ 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 -- cgit v1.2.1