Bug #88916 Assertion `table->s->db_create_options == part_table->s->db_create_options'
Submitted: 14 Dec 2017 10:59 Modified: 14 Dec 2017 11:53
Reporter: Elena Stepanova Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.6, 5.7, 5.6.38, 5.7.20 OS:Any
Assigned to: CPU Architecture:Any

[14 Dec 2017 10:59] Elena Stepanova
Description:
MySQL 5.7 0138556a55 debug build

mysqld: /data/src/mysql-5.7/sql/sql_partition_admin.cc:217: bool compare_table_with_partition(THD*, TABLE*, TABLE*, partition_element*): Assertion `table->s->db_create_options == part_table->s->db_create_options' failed.
10:57:47 UTC - mysqld got signal 6 ;

#7  0x00007f3bda2c8ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00000000017b96ee in compare_table_with_partition (thd=0x7f3b8c02c3e0, table=0x7f3b8c165ca0, part_table=0x7f3b8c128470, part_elem=0x7f3b8c0b1d90) at /data/src/mysql-5.7/sql/sql_partition_admin.cc:216
#9  0x00000000017ba5e1 in Sql_cmd_alter_table_exchange_partition::exchange_partition (this=0x7f3b8c03ea38, thd=0x7f3b8c02c3e0, table_list=0x7f3b8c03dea0, alter_info=0x7f3bd54d4370) at /data/src/mysql-5.7/sql/sql_partition_admin.cc:571
#10 0x00000000017b909d in Sql_cmd_alter_table_exchange_partition::execute (this=0x7f3b8c03ea38, thd=0x7f3b8c02c3e0) at /data/src/mysql-5.7/sql/sql_partition_admin.cc:74
#11 0x0000000001589d2e in mysql_execute_command (thd=0x7f3b8c02c3e0, first_level=true) at /data/src/mysql-5.7/sql/sql_parse.cc:4857
#12 0x000000000158baa7 in mysql_parse (thd=0x7f3b8c02c3e0, parser_state=0x7f3bd54d5690) at /data/src/mysql-5.7/sql/sql_parse.cc:5577
#13 0x00000000015812f6 in dispatch_command (thd=0x7f3b8c02c3e0, com_data=0x7f3bd54d5df0, command=COM_QUERY) at /data/src/mysql-5.7/sql/sql_parse.cc:1461
#14 0x00000000015801d9 in do_command (thd=0x7f3b8c02c3e0) at /data/src/mysql-5.7/sql/sql_parse.cc:999
#15 0x00000000016abfae in handle_connection (arg=0x3c227d0) at /data/src/mysql-5.7/sql/conn_handler/connection_handler_per_thread.cc:300
#16 0x00000000018ee87e in pfs_spawn_thread (arg=0x3bf4950) at /data/src/mysql-5.7/storage/perfschema/pfs.cc:2190
#17 0x00007f3bdb92f494 in start_thread (arg=0x7f3bd54d6700) at pthread_create.c:333
#18 0x00007f3bda38593f in clone () from /lib/x86_64-linux-gnu/libc.so.6

How to repeat:
--source include/have_partition.inc

CREATE TABLE t1 (i INT NOT NULL, KEY (i)) ROW_FORMAT=DYNAMIC PARTITION BY KEY(i) PARTITIONS 2;
CREATE TABLE t2 (i INT NOT NULL, KEY (i));
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;

# Cleanup
DROP TABLE t1, t2;
[14 Dec 2017 11:53] MySQL Verification Team
Hello Elena,

Thank you for the report and test case.
Observed that 5.6.38 and 5.7.20 debug builds are affected.

Thanks,
Umesh
[11 Jan 2021 3:59] Roel Van de Paar
SET SQL_MODE='';
CREATE TABLE t1 (a INT, b VARCHAR(55), PRIMARY KEY(a)) ENGINE=InnoDB PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (100), PARTITION p2 VALUES LESS THAN (1000));
CREATE TABLE t2 (a INT, b VARCHAR(55), PRIMARY KEY(a)) CHECKSUM=1, ENGINE=InnoDB;
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
[11 Jan 2021 3:59] Roel Van de Paar
Confirmed present in MySQL: 5.6.50 (dbg), 5.7.32 (dbg), 8.0.22 (dbg)