Bug #48478 assert in get_table_share called by get_table_share_with_create
Submitted: 2 Nov 2009 16:36 Modified: 10 Nov 2009 13:11
Reporter: Matthias Leich Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version:mysql-6.0-codebase-bugfixing OS:Any
Assigned to: Matthias Leich CPU Architecture:Any
Tags: mdl

[2 Nov 2009 16:36] Matthias Leich
The assertion happens in sql_base.cc:474
    To be able perform any operation on table we should own
    some kind of metadata lock on it.
  DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, table_list->db,

RQG test with 30 threads using the grammar WL5004_sql.yy

Result on mysql-6.0-codebase-bugfixing
revno: 3692 2009-10-31
#0  pthread_kill () from /lib/libpthread.so.0
#1  my_write_core (sig=6) at stacktrace.c:309
#2  handle_segfault (sig=6) at mysqld.cc:2765
#3  <signal handler called>
#4  raise () from /lib/libc.so.6
#5  abort () from /lib/libc.so.6
#6  __assert_fail () from /lib/libc.so.6
#7  get_table_share (thd=0x34dc818, table_list=0x34df768, key=0x7fccf1d14880 "\020\006\nìÌ\177", key_length=18, db_flags=8192, error=0x7fccf1d14874) at sql_base.cc:474
#8  get_table_share_with_create (thd=0x34dc818, table_list=0x34df768, key=0x7fccf1d14880 "\020\006\nìÌ\177", key_length=18, db_flags=8192, error=0x7fccf1d14874) at sql_base.cc:574
#9  open_table (thd=0x34dc818, table_list=0x34df768, mem_root=0x7fccf1d14e00, ot_ctx=0x7fccf1d14e60, flags=0) at sql_base.cc:2678
#10 open_and_process_table (thd=0x34dc818, lex=0x34de0e8, tables=0x34df768, counter=0x7fccf1d14f28, flags=0, prelocking_strategy=0x7fccf1d14f60, has_prelocking_list=false, ot_ctx=0x7fccf1d14e60, new_frm_mem=0x7fccf1d14e00)
    at sql_base.cc:3940
#11 open_tables (thd=0x34dc818, start=0x7fccf1d14ef0, counter=0x7fccf1d14f28, flags=0, prelocking_strategy=0x7fccf1d14f60) at sql_base.cc:4178
#12 open_and_lock_tables_derived (thd=0x34dc818, tables=0x34df768, derived=false, flags=0, prelocking_strategy=0x7fccf1d14f60) at sql_base.cc:4763
#13 open_and_lock_tables_derived (thd=0x34dc818, tables=0x34df768, derived=false, flags=0) at ../mysql_priv.h:1518
#14 open_n_lock_single_table (thd=0x34dc818, table_l=0x34df768, lock_type=TL_WRITE_DELAYED, flags=0) at sql_base.cc:4594
#15 Delayed_insert::open_and_lock_table (this=0x34dc7f8) at sql_insert.cc:2357
#16 handle_delayed_insert_impl (thd=0x34dc818, di=0x34dc7f8) at sql_insert.cc:2407
#17 handle_delayed_insert (arg=0x34dc7f8) at sql_insert.cc:2632
#18 start_thread () from /lib/libpthread.so.0
#19 clone () from /lib/libc.so.6
#20 ?? ()

How to repeat:
I will come up with a simplified testcase soon.
[10 Nov 2009 13:11] Matthias Leich
Any attempt to replay this bug like grammar simplification
was not successful. Therefor I set this bug to
"Can't repeat" but will restart attempts if I have the time.