From 8881c0100e2131077410b360b27b7af30db56e1a Mon Sep 17 00:00:00 2001 From: KiyoshiTakeda Date: Wed, 18 May 2022 23:38:56 +0900 Subject: MDEV-14642 Assertion 'table->s->db_create_options == part_table->s->db_create_options' failed in compare_table_with_partition When trying to execute ALTER TABLE EXCHANGE PARTITION with different definitions, assertion table->s->db_create_options == part_table->s->db_create_options failed in compare_table_with_partition(). However, this execution should not be allowed since executing 'exchange partition' requires the identical structure of the two tables. To fix the problem, I deleted the assertion code and added code that returns an error that indicates tables have different definitions. Reviewed By: Nayuta Yanagisawa --- sql/sql_partition_admin.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sql/sql_partition_admin.cc') diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 90156a76dec..cec7ecc6806 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -249,8 +249,13 @@ static bool compare_table_with_partition(THD *thd, TABLE *table, my_error(ER_TABLES_DIFFERENT_METADATA, MYF(0)); DBUG_RETURN(TRUE); } - DBUG_ASSERT(table->s->db_create_options == - part_table->s->db_create_options); + + if (table->s->db_create_options != part_table->s->db_create_options) + { + my_error(ER_TABLES_DIFFERENT_METADATA, MYF(0)); + DBUG_RETURN(TRUE); + } + DBUG_ASSERT(table->s->db_options_in_use == part_table->s->db_options_in_use); -- cgit v1.2.1