Bug #83117 Assertion `MDL_checker::is_read_locked(m_thd, *object)' failed.
Submitted: 23 Sep 2016 4:39 Modified: 16 Nov 2016 1:05
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:8.0-dmr OS:Any
Assigned to: CPU Architecture:Any

[23 Sep 2016 4:39] Roel Van de Paar
Description:
Version: '8.0.0-dmr-debug'  socket: '/sda/MS130916-mysql-8.0.0-dmr-linux-x86_64-debug/socket.sock'  port: 15348  MySQL Community Server (GPL)
mysqld: /git/MS8.0_dbg/sql/dd/impl/cache/dictionary_client.cc:610: bool dd::cache::Dictionary_client::acquire(const K&, const T**, bool*) [with K = dd::Item_name_key; T = dd::Abstract_table]: Assertion `MDL_checker::is_read_locked(m_thd, *object)' failed.
04:21:44 UTC - mysqld got signal 6 ;

+bt
#0  0x00007f6a421e4741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000023fc1b9 in my_write_core (sig=6) at /git/MS8.0_dbg/mysys/stacktrace.cc:275
#2  0x0000000001b517ed in handle_fatal_signal (sig=6) at /git/MS8.0_dbg/sql/signal_handler.cc:219
#3  <signal handler called>
#4  0x00007f6a4057b5f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f6a4057cce8 in __GI_abort () at abort.c:90
#6  0x00007f6a40574566 in __assert_fail_base (fmt=0x7f6a406c4ce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x2f115c0 "MDL_checker::is_read_locked(m_thd, *object)", file=file@entry=0x2f11078 "/git/MS8.0_dbg/sql/dd/impl/cache/dictionary_client.cc", line=line@entry=610, function=function@entry=0x2f174c0 <bool dd::cache::Dictionary_client::acquire<dd::Item_name_key, dd::Abstract_table>(dd::Item_name_key const&, dd::Abstract_table const**, bool*)::__PRETTY_FUNCTION__> "bool dd::cache::Dictionary_client::acquire(const K&, const T**, bool*) [with K = dd::Item_name_key; T = dd::Abstract_table]") at assert.c:92
#7  0x00007f6a40574612 in __GI___assert_fail (assertion=0x2f115c0 "MDL_checker::is_read_locked(m_thd, *object)", file=0x2f11078 "/git/MS8.0_dbg/sql/dd/impl/cache/dictionary_client.cc", line=610, function=0x2f174c0 <bool dd::cache::Dictionary_client::acquire<dd::Item_name_key, dd::Abstract_table>(dd::Item_name_key const&, dd::Abstract_table const**, bool*)::__PRETTY_FUNCTION__> "bool dd::cache::Dictionary_client::acquire(const K&, const T**, bool*) [with K = dd::Item_name_key; T = dd::Abstract_table]") at assert.c:101
#8  0x0000000001a0a098 in dd::cache::Dictionary_client::acquire<dd::Item_name_key, dd::Abstract_table> (this=0x7f6a0f81d000, key=..., object=0x7f6a427d29c0, local=0x7f6a427d29bf) at /git/MS8.0_dbg/sql/dd/impl/cache/dictionary_client.cc:610
#9  0x00000000019f8220 in dd::cache::Dictionary_client::acquire<dd::Table> (this=0x7f6a0f81d000, schema_name="world", object_name="t1", object=0x7f6a427d3668) at /git/MS8.0_dbg/sql/dd/impl/cache/dictionary_client.cc:948
#10 0x00000000019bc81f in dd::table_has_triggers (thd=0x7f6a0f819000, schema_name=0x7f6a0f82df58 "world", table_name=0x7f6a0f82d990 "t1", table_has_trigger=0x7f6a427d5827) at /git/MS8.0_dbg/sql/dd/dd_trigger.cc:518
#11 0x00000000018facaa in mysql_alter_table (thd=0x7f6a0f819000, new_db=0x7f6a0f82e050 "test", new_name=0x7f6a0f82e058 "t1", create_info=0x7f6a427d5be0, table_list=0x7f6a0f82d9c8, alter_info=0x7f6a427d5cd0) at /git/MS8.0_dbg/sql/sql_table.cc:9926
#12 0x000000000227fccb in Sql_cmd_alter_table::execute (this=0x7f6a0f82e088, thd=0x7f6a0f819000) at /git/MS8.0_dbg/sql/sql_alter.cc:329
#13 0x0000000001873f65 in mysql_execute_command (thd=0x7f6a0f819000, first_level=true) at /git/MS8.0_dbg/sql/sql_parse.cc:4562
#14 0x0000000001875c14 in mysql_parse (thd=0x7f6a0f819000, parser_state=0x7f6a427d74e0) at /git/MS8.0_dbg/sql/sql_parse.cc:5233
#15 0x000000000186c3b8 in dispatch_command (thd=0x7f6a0f819000, com_data=0x7f6a427d7c70, command=COM_QUERY) at /git/MS8.0_dbg/sql/sql_parse.cc:1481
#16 0x000000000186b244 in do_command (thd=0x7f6a0f819000) at /git/MS8.0_dbg/sql/sql_parse.cc:1043
#17 0x0000000001b43af1 in handle_connection (arg=0x7f6a0f16c080) at /git/MS8.0_dbg/sql/conn_handler/connection_handler_per_thread.cc:301
#18 0x000000000242bf29 in pfs_spawn_thread (arg=0x7f6a0f1e4e20) at /git/MS8.0_dbg/storage/perfschema/pfs.cc:2282
#19 0x00007f6a421dfdc5 in start_thread (arg=0x7f6a427d8700) at pthread_create.c:308
#20 0x00007f6a4063cced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
# mysqld options required for replay:  --sql_mode=
DROP DATABASE test;
CREATE DATABASE world;
use world;
create TABLE t1(a int,b char,primary key using hash(a)) ENGINE=INNODB;
CREATE TEMPORARY TABLE t1(c1 INT)ENGINE=MRG_TokuDB UNION=(t1) INSERT_METHOD=LAST;
alter table t1 rename to test.t1;
[23 Sep 2016 5:22] MySQL Verification Team
Hello Roel,

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

Thanks,
Umesh
[16 Nov 2016 1:05] Paul DuBois
Posted by developer:
 
Noted in 8.0.1 changelog.

ALTER TABLE on a temporary table could raise an assertion if a
nontemporary table with the same name existed.