Bug #92097 InnoDB: Assertion failure: ha_innopart.cc:3715:can_switch
Submitted: 21 Aug 2018 2:53 Modified: 24 Aug 2018 2:27
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S6 (Debug Builds)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any

[21 Aug 2018 2:53] Roel Van de Paar
Description:
2018-08-21T02:51:37.042303Z 9 [ERROR] [MY-000000] [InnoDB] InnoDB: Assertion failure: ha_innopart.cc:3715:can_switch

Core was generated by `/sda/3/bin/mysqld --no-defaults --core-file --basedir=/sda/3 --tmpdir=/sda/3/da'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x7ffb4d8da700 (LWP 23670))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000555af0c6778d in my_write_core (sig=6) at /git/MS-8.0.12_dbg/mysys/stacktrace.cc:278
#2  0x0000555aef9bbd94 in handle_fatal_signal (sig=6) at /git/MS-8.0.12_dbg/sql/signal_handler.cc:249
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x00007ffb4d91b801 in __GI_abort () at abort.c:79
#6  0x0000555af1051239 in ut_dbg_assertion_failed (expr=0x555af221d498 "can_switch", 
    file=0x555af221bb58 "/git/MS-8.0.12_dbg/storage/innobase/handler/ha_innopart.cc", line=3715)
    at /git/MS-8.0.12_dbg/storage/innobase/ut/ut0dbg.cc:90
#7  0x0000555af0de3446 in ha_innopart::can_switch_engines (this=0x7ffb1f6a8028)
    at /git/MS-8.0.12_dbg/storage/innobase/handler/ha_innopart.cc:3715
#8  0x0000555aef8cb777 in mysql_alter_table (thd=0x7ffb1f423000, new_db=0x7ffb1f470298 "test", new_name=0x0, 
    create_info=0x7ffb4d8d78b0, table_list=0x7ffb1f46fd10, alter_info=0x7ffb4d8d79a0) at /git/MS-8.0.12_dbg/sql/sql_table.cc:13287
#9  0x0000555aefd99e7a in Sql_cmd_alter_table::execute (this=0x7ffb1f4702a0, thd=0x7ffb1f423000)
    at /git/MS-8.0.12_dbg/sql/sql_alter.cc:330
#10 0x0000555aef812a19 in mysql_execute_command (thd=0x7ffb1f423000, first_level=true) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:4210
#11 0x0000555aef814f94 in mysql_parse (thd=0x7ffb1f423000, parser_state=0x7ffb4d8d9330) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:4925
#12 0x0000555aef80aaeb in dispatch_command (thd=0x7ffb1f423000, com_data=0x7ffb4d8d9c90, command=COM_QUERY)
    at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1607
#13 0x0000555aef8093c6 in do_command (thd=0x7ffb1f423000) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1232
#14 0x0000555aef9a9678 in handle_connection (arg=0x7ffb3b38f4c0)
    at /git/MS-8.0.12_dbg/sql/conn_handler/connection_handler_per_thread.cc:308
#15 0x0000555af1318422 in pfs_spawn_thread (arg=0x7ffb413e7720) at /git/MS-8.0.12_dbg/storage/perfschema/pfs.cc:2836
#16 0x00007ffb4f3076db in start_thread (arg=0x7ffb4d8da700) at pthread_create.c:463
#17 0x00007ffb4d9fc88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
CREATE DATABASE test;
USE test;
create table t1(a int key,b int);
ALTER TABLE t1 ADD FOREIGN KEY(a)REFERENCES t1(a);
alter TABLE t1 partition by key(a)(partition p0,partition p1 );
alter table t1 remove partitioning;
[21 Aug 2018 5:01] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 8.0.12 debug build affected.

regards,
Umesh
[21 Aug 2018 5:09] MySQL Verification Team
# 5.7.23 - debug/release not affected with provided test case
[24 Aug 2018 2:27] Jon Stephens
Fixed in MySQL 8.0.13 by a fix for another issue.

Closed.