Bug #92057 index->type & 32 || root != FIL_NULL || dict_table_is_discarded(m_table)
Submitted: 17 Aug 2018 11:57 Modified: 26 Oct 2018 7:18
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

[17 Aug 2018 11:57] Roel Van de Paar
Description:
2018-08-17T11:54:29.050596Z 9 [ERROR] [MY-012592] [InnoDB] InnoDB: Operating system error number 2 in a file operation.
2018-08-17T11:54:29.050634Z 9 [ERROR] [MY-012593] [InnoDB] InnoDB: The error means the system cannot find the path specified.
2018-08-17T11:54:29.050653Z 9 [ERROR] [MY-012216] [InnoDB] InnoDB: Cannot open datafile for read-only: './test/t1#P#p0.ibd' OS error: 71
2018-08-17T11:54:29.050677Z 9 [ERROR] [MY-000000] [InnoDB] InnoDB: Assertion failure: dict0dd.cc:4013:index->type & 32 || root != FIL_NULL || dict_table_is_discarded(m_table)

Core was generated by `/sda/MS300718-mysql-8.0.12-linux-x86_64-debug/bin/mysqld --no-defaults --core-f'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
57	../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5921bd4700 (LWP 31028))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000560d4b6b478d in my_write_core (sig=6) at /git/MS-8.0.12_dbg/mysys/stacktrace.cc:278
#2  0x0000560d4a408d94 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  0x00007f5921c15801 in __GI_abort () at abort.c:79
#6  0x0000560d4ba9e239 in ut_dbg_assertion_failed (
    expr=0x560d4cd60b80 "index->type & 32 || root != FIL_NULL || dict_table_is_discarded(m_table)", 
    file=0x560d4cd5ee18 "/git/MS-8.0.12_dbg/storage/innobase/dict/dict0dd.cc", line=4013)
    at /git/MS-8.0.12_dbg/storage/innobase/ut/ut0dbg.cc:90
#7  0x0000560d4bbb6d85 in dd_open_table_one<dd::Partition> (client=0x7f5900f35000, table=0x7f58d5d39e20, 
    norm_name=0x7f5921bcacd0 "test/t1#P#p0", dd_table=0x7f58d5d9b938, thd=0x7f5900f0f000, fk_list=std::deque with 0 elements)
    at /git/MS-8.0.12_dbg/storage/innobase/dict/dict0dd.cc:4012
#8  0x0000560d4bbb4c46 in dd_open_table<dd::Partition> (client=0x7f5900f35000, table=0x7f58d5d39e20, 
    norm_name=0x7f5921bcacd0 "test/t1#P#p0", dd_table=0x7f58d5d9b938, thd=0x7f5900f0f000)
    at /git/MS-8.0.12_dbg/storage/innobase/dict/dict0dd.cc:4229
#9  0x0000560d4b82598c in Ha_innopart_share::open_one_table_part (this=0x7f58d5d15f40, client=0x7f5900f35000, thd=0x7f5900f0f000, 
    table=0x7f58d5d39e20, dd_part=0x7f58d5d9b938, part_name=0x7f5921bcacd0 "test/t1#P#p0", part_id=0)
    at /git/MS-8.0.12_dbg/storage/innobase/handler/ha_innopart.cc:219
#10 0x0000560d4b826138 in Ha_innopart_share::open_table_parts (this=0x7f58d5d15f40, thd=0x7f5900f0f000, table=0x7f58d5d39e20, 
    dd_table=0x7f5900f0aef8, part_info=0x7f58d5d38708, table_name=0x7f5921bcb110 "test/t1")
    at /git/MS-8.0.12_dbg/storage/innobase/handler/ha_innopart.cc:342
#11 0x0000560d4b826f7f in ha_innopart::open (this=0x7f58d5d89028, name=0x7f5900f47858 "./test/t1", table_def=0x7f5900f0aef8)
    at /git/MS-8.0.12_dbg/storage/innobase/handler/ha_innopart.cc:823
#12 0x0000560d4a58bdad in handler::ha_open (this=0x7f58d5d89028, table_arg=0x7f58d5d39e20, name=0x7f5900f47858 "./test/t1", mode=2, 
    test_if_locked=2, table_def=0x7f5900f0aef8) at /git/MS-8.0.12_dbg/sql/handler.cc:2633
#13 0x0000560d4a399c8f in open_table_from_share (thd=0x7f5900f0f000, share=0x7f5900f47528, alias=0x7f5900f5b9e0 "t1", db_stat=39, 
    prgflag=8, ha_open_flags=0, outparam=0x7f58d5d39e20, is_create_table=false, table_def_param=0x7f5900f0aef8)
    at /git/MS-8.0.12_dbg/sql/table.cc:2952
#14 0x0000560d4a1c5d63 in open_table (thd=0x7f5900f0f000, table_list=0x7f5921bcd790, ot_ctx=0x7f5921bcd730)
    at /git/MS-8.0.12_dbg/sql/sql_base.cc:3298
#15 0x0000560d4a3109e2 in mysql_inplace_alter_table (thd=0x7f5900f0f000, schema=..., new_schema=..., table_def=0x0, 
    altered_table_def=0x7f5900f09af8, table_list=0x7f5900f5be18, table=0x0, altered_table=0x7f5900e94020, 
    ha_alter_info=0x7f5921bceee0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f5921bcfff0, 
    alter_ctx=0x7f5921bd0900, columns=std::set with 0 elements, fk_key_info=0x7f58d5c91c70, fk_key_count=0, 
    fk_invalidator=0x7f5921bcdf70) at /git/MS-8.0.12_dbg/sql/sql_table.cc:10875
#16 0x0000560d4a3199c0 in mysql_alter_table (thd=0x7f5900f0f000, new_db=0x7f5900f5c3a0 "test", new_name=0x0, 
    create_info=0x7f5921bd18b0, table_list=0x7f5900f5be18, alter_info=0x7f5921bd19a0) at /git/MS-8.0.12_dbg/sql/sql_table.cc:13760
#17 0x0000560d4a7e6e7a in Sql_cmd_alter_table::execute (this=0x7f5900f5c480, thd=0x7f5900f0f000)
    at /git/MS-8.0.12_dbg/sql/sql_alter.cc:330
#18 0x0000560d4a25fa19 in mysql_execute_command (thd=0x7f5900f0f000, first_level=true) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:4210
#19 0x0000560d4a261f94 in mysql_parse (thd=0x7f5900f0f000, parser_state=0x7f5921bd3330) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:4925
#20 0x0000560d4a257aeb in dispatch_command (thd=0x7f5900f0f000, com_data=0x7f5921bd3c90, command=COM_QUERY)
    at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1607
#21 0x0000560d4a2563c6 in do_command (thd=0x7f5900f0f000) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1232
#22 0x0000560d4a3f6678 in handle_connection (arg=0x7f590f3a4480)
    at /git/MS-8.0.12_dbg/sql/conn_handler/connection_handler_per_thread.cc:308
#23 0x0000560d4bd65422 in pfs_spawn_thread (arg=0x7f59153e7820) at /git/MS-8.0.12_dbg/storage/perfschema/pfs.cc:2836
#24 0x00007f59236016db in start_thread (arg=0x7f5921bd4700) at pthread_create.c:463
#25 0x00007f5921cf688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
CREATE DATABASE test;
USE test;
CREATE TABLE t1(c1 INT,c2 CHAR)PARTITION BY HASH(c1) PARTITIONS 10;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1 ADD c4 FLOAT AFTER c2;
[17 Aug 2018 12:02] MySQL Verification Team
Hello Roel,

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

regards,
Umesh
[26 Oct 2018 7:18] Jon Stephens
Documented fix as follows in the MySQL 8.0.14:

    Trying to perform an instant add column on a discarded
    tablespace led to an assert. An error is now return in 
    such cases.

Closed.