Bug #86297 Assertion `thd->mdl_context.owns_equal_or_stronger_lock( MDL_key::TABLESPACE, ""
Submitted: 12 May 2017 7:28 Modified: 12 May 2017 10:09
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[12 May 2017 7:28] Roel Van de Paar
Description:
Version: '8.0.1-dmr-debug'  socket: '/sda/MS120517-mysql-8.0.1-dmr-linux-x86_64-debug/socket.sock'  port: 12055  MySQL Community Server (GPL)
mysqld: /git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc:1361: bool dd::fill_dd_tablespace_id_or_name(THD*, T*, handlerton*, const char*, bool) [with T = dd::Table]: Assertion `thd->mdl_context.owns_equal_or_stronger_lock( MDL_key::TABLESPACE, "", tablespace_name, MDL_INTENTION_EXCLUSIVE)' failed.
07:01:49 UTC - mysqld got signal 6;

How to repeat:
DROP DATABASE test;
use mysql;
create table t1(b char);
LOCK TABLES t1 WRITE;
ALTER TABLE t1 TABLESPACE space1 STORAGE DISK ENGINE=InnoDB;
[12 May 2017 7:29] Roel Van de Paar
Core was generated by `/sda/MS120517-mysql-8.0.1-dmr-linux-x86_64-debug/bin/mysqld --no-defaults --cor'.
Program terminated with signal 6, Aborted.
#0  0x00007f9fadb15741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007f9fadb15741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000002609fc9 in my_write_core (sig=6) at /git/mysql-8.0.1-dmr_dbg/mysys/stacktrace.cc:291
#2  0x0000000001d14c5c in handle_fatal_signal (sig=6) at /git/mysql-8.0.1-dmr_dbg/sql/signal_handler.cc:231
#3  <signal handler called>
#4  0x00007f9fabea91d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f9fabeaa8c8 in __GI_abort () at abort.c:90
#6  0x00007f9fabea2146 in __assert_fail_base (fmt=0x7f9fabff33a8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x32b9980 "thd->mdl_context.owns_equal_or_stronger_lock( MDL_key::TABLESPACE, \"\", tablespace_name, MDL_INTENTION_EXCLUSIVE)", file=file@entry=0x32b8c50 "/git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc", line=line@entry=1361, 
    function=function@entry=0x32ba800 <bool dd::fill_dd_tablespace_id_or_name<dd::Table>(THD*, dd::Table*, handlerton*, char const*, bool)::__PRETTY_FUNCTION__> "bool dd::fill_dd_tablespace_id_or_name(THD*, T*, handlerton*, const char*, bool) [with T = dd::Table]")
    at assert.c:92
#7  0x00007f9fabea21f2 in __GI___assert_fail (
    assertion=0x32b9980 "thd->mdl_context.owns_equal_or_stronger_lock( MDL_key::TABLESPACE, \"\", tablespace_name, MDL_INTENTION_EXCLUSIVE)", file=0x32b8c50 "/git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc", line=1361, 
    function=0x32ba800 <bool dd::fill_dd_tablespace_id_or_name<dd::Table>(THD*, dd::Table*, handlerton*, char const*, bool)::__PRETTY_FUNCTION__> "bool dd::fill_dd_tablespace_id_or_name(THD*, T*, handlerton*, const char*, bool) [with T = dd::Table]") at assert.c:101
#8  0x0000000001b7757a in dd::fill_dd_tablespace_id_or_name<dd::Table> (thd=0x7f9f66419000, obj=0x7f9f664ad238, hton=0x7f9faa00ed20, 
    tablespace_name=0x7f9f66431090 "space1", is_temporary_table=false) at /git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc:1358
#9  0x0000000001b7280b in dd::fill_dd_table_from_create_info (thd=0x7f9f66419000, tab_obj=0x7f9f664ad238, table_name="#sql-6c64_3", 
    create_info=0x7f9fae105b80, create_fields=..., keyinfo=0x7f9f664312c8, keys=0, keys_onoff=Alter_info::LEAVE_AS_IS, 
    fk_keyinfo=0x7f9f664312c8, fk_keys=0, file=0x7f9f66589030) at /git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc:2111
#10 0x0000000001b73083 in dd::create_dd_user_table (thd=0x7f9f66419000, schema_name="mysql", table_name="#sql-6c64_3", 
    create_info=0x7f9fae105b80, create_fields=..., keyinfo=0x7f9f664312c8, keys=0, keys_onoff=Alter_info::LEAVE_AS_IS, 
    fk_keyinfo=0x7f9f664312c8, fk_keys=0, file=0x7f9f66589030, commit_dd_changes=false)
    at /git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc:2248
#11 0x0000000001b732ce in dd::create_table (thd=0x7f9f66419000, schema_name="mysql", table_name="#sql-6c64_3", 
    create_info=0x7f9fae105b80, create_fields=..., keyinfo=0x7f9f664312c8, keys=0, keys_onoff=Alter_info::LEAVE_AS_IS, 
    fk_keyinfo=0x7f9f664312c8, fk_keys=0, file=0x7f9f66589030, commit_dd_changes=false)
    at /git/mysql-8.0.1-dmr_dbg/sql/dd/dd_table.cc:2306
#12 0x0000000001aa1330 in rea_create_base_table (thd=0x7f9f66419000, path=0x7f9fae103efc "./mysql/#sql-6c64_3", 
    db=0x7f9f66430f98 "mysql", table_name=0x7f9fae103670 "#sql-6c64_3", create_info=0x7f9fae105b80, create_fields=..., keys=0, 
    key_info=0x7f9f664312c8, keys_onoff=Alter_info::LEAVE_AS_IS, fk_keys=0, fk_key_info=0x7f9f664312c8, file=0x7f9f66589030, 
    no_ha_table=true, part_info=0x0, binlog_to_trx_cache=0x0, post_ddl_ht=0x0) at /git/mysql-8.0.1-dmr_dbg/sql/sql_table.cc:2203
#13 0x0000000001aadb04 in create_table_impl (thd=0x7f9f66419000, db=0x7f9f66430f98 "mysql", table_name=0x7f9fae103670 "#sql-6c64_3", 
    error_table_name=0x7f9f664309e0 "t1", path=0x7f9fae103efc "./mysql/#sql-6c64_3", create_info=0x7f9fae105b80, 
    alter_info=0x7f9fae105c70, internal_tmp_table=true, select_field_count=0, no_ha_table=true, is_trans=0x0, key_info=0x7f9fae105998, 
    key_count=0x7f9fae105994, keys_onoff=Alter_info::LEAVE_AS_IS, fk_key_info=0x7f9fae105988, fk_key_count=0x7f9fae105984, 
    existing_fk_info=0x7f9f664312c8, existing_fk_count=0, tmp_table_def=0x7f9fae105978, post_ddl_ht=0x0)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_table.cc:7577
#14 0x0000000001abac7e in mysql_alter_table (thd=0x7f9f66419000, new_db=0x7f9f66430f98 "mysql", new_name=0x0, 
    create_info=0x7f9fae105b80, table_list=0x7f9f66430a18, alter_info=0x7f9fae105c70)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_table.cc:12666
#15 0x000000000200f0ac in Sql_cmd_alter_table::execute (this=0x7f9f664311a8, thd=0x7f9f66419000)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_alter.cc:356
#16 0x0000000001a25755 in mysql_execute_command (thd=0x7f9f66419000, first_level=true)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_parse.cc:4545
#17 0x0000000001a276ad in mysql_parse (thd=0x7f9f66419000, parser_state=0x7f9fae107480)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_parse.cc:5333
#18 0x0000000001a1dd3e in dispatch_command (thd=0x7f9f66419000, com_data=0x7f9fae107c80, command=COM_QUERY)
    at /git/mysql-8.0.1-dmr_dbg/sql/sql_parse.cc:1593
#19 0x0000000001a1cbc5 in do_command (thd=0x7f9f66419000) at /git/mysql-8.0.1-dmr_dbg/sql/sql_parse.cc:1180
#20 0x0000000001d06d36 in handle_connection (arg=0x7f9f9cf4e400)
    at /git/mysql-8.0.1-dmr_dbg/sql/conn_handler/connection_handler_per_thread.cc:322
#21 0x000000000263cdae in pfs_spawn_thread (arg=0x7f9f65e81020) at /git/mysql-8.0.1-dmr_dbg/storage/perfschema/pfs.cc:2407
#22 0x00007f9fadb10dc5 in start_thread (arg=0x7f9fae108700) at pthread_create.c:308
#23 0x00007f9fabf6b73d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
[12 May 2017 10:09] MySQL Verification Team
Thank you for the bug report.