Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28774

Assertion `table->in_use && tdc->flushed' failed in bool TABLE_SHARE::visit_subgraph(Wait_for_flush*, MDL_wait_for_graph_visitor*)

    XMLWordPrintable

Details

    Description

      CREATE TABLE t AS SELECT CONCAT (MAKEDATE (2009,1)) AS c;
      EXPLAIN SELECT * FROM t WHERE c=(SELECT * FROM t WHERE c IN (SELECT 1 FROM t));
      ALTER TABLE t CHANGE c c INT ;
      INSERT INTO t VALUES (1);
      

      Leads to

      10.10.0 d7a7d16713070c7c2902c3df4b4f6d024cd0320f (Debug)

      mysqld: /test/mtest/10.10_dbg/sql/table.cc:5496: bool TABLE_SHARE::visit_subgraph(Wait_for_flush*, MDL_wait_for_graph_visitor*): Assertion `table->in_use && tdc->flushed' failed.
      

      10.10.0 d7a7d16713070c7c2902c3df4b4f6d024cd0320f (Debug)

      Core was generated by `/test/mtest/GAL_MD080622-mariadb-10.10.0-linux-x86_64-dbg/bin/mysqld --no-defau'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x147b10f6e700 (LWP 2557840))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055dbab5896eb in my_write_core (sig=sig@entry=6) at /test/mtest/10.10_dbg/mysys/stacktrace.c:424
      #2  0x000055dbaae2f2c7 in handle_fatal_signal (sig=6) at /test/mtest/10.10_dbg/sql/signal_handler.cc:345
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000147b29920859 in __GI_abort () at abort.c:79
      #6  0x0000147b29920729 in __assert_fail_base (fmt=0x147b29ab6588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55dbab75d23f "table->in_use && tdc->flushed", file=0x55dbab75d7d0 "/test/mtest/10.10_dbg/sql/table.cc", line=5496, function=<optimized out>) at assert.c:92
      #7  0x0000147b29931f36 in __GI___assert_fail (assertion=assertion@entry=0x55dbab75d23f "table->in_use && tdc->flushed", file=file@entry=0x55dbab75d7d0 "/test/mtest/10.10_dbg/sql/table.cc", line=line@entry=5496, function=function@entry=0x55dbab75e460 "bool TABLE_SHARE::visit_subgraph(Wait_for_flush*, MDL_wait_for_graph_visitor*)") at assert.c:101
      #8  0x000055dbaac624bf in TABLE_SHARE::visit_subgraph (this=0x147adc01dc00, wait_for_flush=<optimized out>, gvisitor=0x147b10f6c400) at /test/mtest/10.10_dbg/sql/table.cc:5496
      #9  0x000055dbaac6261a in Wait_for_flush::accept_visitor (this=<optimized out>, gvisitor=<optimized out>) at /test/mtest/10.10_dbg/sql/table.cc:5438
      #10 0x000055dbaacb8fa2 in MDL_context::visit_subgraph (this=this@entry=0x147adc000f08, gvisitor=gvisitor@entry=0x147b10f6c400) at /test/mtest/10.10_dbg/sql/mdl.cc:2792
      #11 0x000055dbaacb9449 in MDL_context::find_deadlock (this=this@entry=0x147adc000f08) at /test/mtest/10.10_dbg/sql/mdl.cc:2820
      #12 0x000055dbaac627c9 in TABLE_SHARE::wait_for_old_version (this=0x147adc01dc00, thd=thd@entry=0x147adc000db8, abstime=abstime@entry=0x147b10f6c4c0, deadlock_weight=deadlock_weight@entry=1) at /test/mtest/10.10_dbg/sql/table.cc:5568
      #13 0x000055dbaad8b849 in tdc_wait_for_old_version (thd=thd@entry=0x147adc000db8, db=<optimized out>, table_name=<optimized out>, wait_timeout=<optimized out>, deadlock_weight=1) at /test/mtest/10.10_dbg/sql/table_cache.cc:1094
      #14 0x000055dbaaabfd8e in open_table (thd=thd@entry=0x147adc000db8, table_list=table_list@entry=0x147adc013d18, ot_ctx=ot_ctx@entry=0x147b10f6cbb0) at /test/mtest/10.10_dbg/sql/sql_base.h:561
      #15 0x000055dbaaac48c8 in open_and_process_table (ot_ctx=0x147b10f6cbb0, has_prelocking_list=false, prelocking_strategy=0x147b10f6cd50, flags=0, counter=0x147b10f6cc4c, tables=0x147adc013d18, thd=0x147adc000db8) at /test/mtest/10.10_dbg/sql/sql_base.cc:4087
      #16 open_tables (thd=thd@entry=0x147adc000db8, options=@0x147adc0064d8: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x147b10f6cc38, counter=counter@entry=0x147b10f6cc4c, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x147b10f6cd50) at /test/mtest/10.10_dbg/sql/sql_base.cc:4574
      #17 0x000055dbaaac585a in open_and_lock_tables (thd=thd@entry=0x147adc000db8, options=@0x147adc0064d8: {m_options = DDL_options_st::OPT_NONE}, tables=<optimized out>, tables@entry=0x147adc013d18, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x147b10f6cd50) at /test/mtest/10.10_dbg/sql/sql_base.cc:5547
      #18 0x000055dbaab0a200 in open_and_lock_tables (flags=0, derived=true, tables=0x147adc013d18, thd=0x147adc000db8) at /test/mtest/10.10_dbg/sql/sql_base.h:510
      #19 mysql_insert (thd=thd@entry=0x147adc000db8, table_list=0x147adc013d18, fields=@0x147adc005e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55dbac02fa00 <end_of_list>, last = 0x147adc005e90, elements = 0}, <No data fields>}, values_list=@0x147adc005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147adc014928, last = 0x147adc014928, elements = 1}, <No data fields>}, update_fields=@0x147adc005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55dbac02fa00 <end_of_list>, last = 0x147adc005ec0, elements = 0}, <No data fields>}, update_values=@0x147adc005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55dbac02fa00 <end_of_list>, last = 0x147adc005ea8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/mtest/10.10_dbg/sql/sql_insert.cc:758
      #20 0x000055dbaab4f09f in mysql_execute_command (thd=thd@entry=0x147adc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/mtest/10.10_dbg/sql/sql_parse.cc:4562
      #21 0x000055dbaab3b605 in mysql_parse (thd=thd@entry=0x147adc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147b10f6d470) at /test/mtest/10.10_dbg/sql/sql_parse.cc:8036
      #22 0x000055dbaab48cc1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147adc000db8, packet=packet@entry=0x147adc00b6e9 "INSERT INTO t VALUES (1)", packet_length=packet_length@entry=24, blocking=blocking@entry=true) at /test/mtest/10.10_dbg/sql/sql_class.h:1365
      #23 0x000055dbaab4b3d1 in do_command (thd=0x147adc000db8, blocking=blocking@entry=true) at /test/mtest/10.10_dbg/sql/sql_parse.cc:1407
      #24 0x000055dbaacad433 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55dbadf8e5a8, put_in_cache=put_in_cache@entry=true) at /test/mtest/10.10_dbg/sql/sql_connect.cc:1418
      #25 0x000055dbaacad93f in handle_one_connection (arg=0x55dbadf8e5a8) at /test/mtest/10.10_dbg/sql/sql_connect.cc:1312
      #26 0x0000147b29e2f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x0000147b29a1d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Stack trace from release build

      10.10.0 d7a7d16713070c7c2902c3df4b4f6d024cd0320f (Optimized)

      Core was generated by `/test/mtest/GAL_MD080622-mariadb-10.10.0-linux-x86_64-opt/bin/mysqld --no-defau'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x14993555e700 (LWP 2584094))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055d49c0c119f in my_write_core (sig=sig@entry=11) at /test/mtest/10.10_opt/mysys/stacktrace.c:424
      #2  0x000055d49bc10170 in handle_fatal_signal (sig=11) at /test/mtest/10.10_opt/sql/signal_handler.cc:345
      #3  <signal handler called>
      #4  __GI___pthread_mutex_lock (mutex=mutex@entry=0x1e8) at ../nptl/pthread_mutex_lock.c:67
      #5  0x000055d49c0c43a6 in rw_pr_rdlock (rwlock=rwlock@entry=0x1e8) at /test/mtest/10.10_opt/mysys/thr_rwlock.c:282
      #6  0x000055d49baf2d67 in inline_mysql_prlock_rdlock (that=0x1e8) at /test/mtest/10.10_opt/include/mysql/psi/mysql_thread.h:919
      #7  MDL_context::visit_subgraph (this=0x150, gvisitor=gvisitor@entry=0x14993555c2d0) at /test/mtest/10.10_opt/sql/mdl.cc:2789
      #8  0x000055d49bab89bf in TABLE_SHARE::visit_subgraph (this=0x149900016f10, wait_for_flush=<optimized out>, gvisitor=0x14993555c2d0) at /test/mtest/10.10_opt/sql/table.cc:5507
      #9  0x000055d49baf2db8 in MDL_context::visit_subgraph (this=this@entry=0x149900000da8, gvisitor=gvisitor@entry=0x14993555c2d0) at /test/mtest/10.10_opt/sql/mdl.cc:2796
      #10 0x000055d49baf31bb in MDL_context::find_deadlock (this=this@entry=0x149900000da8) at /test/mtest/10.10_opt/sql/mdl.cc:2820
      #11 0x000055d49bab8af3 in TABLE_SHARE::wait_for_old_version (this=0x149900016f10, thd=thd@entry=0x149900000c58, abstime=abstime@entry=0x14993555c3b0, deadlock_weight=deadlock_weight@entry=1) at /test/mtest/10.10_opt/sql/table.cc:5568
      #12 0x000055d49bb93aaa in tdc_wait_for_old_version (thd=thd@entry=0x149900000c58, db=<optimized out>, table_name=<optimized out>, wait_timeout=<optimized out>, deadlock_weight=1) at /test/mtest/10.10_opt/sql/table_cache.cc:1094
      #13 0x000055d49b962b73 in open_table (thd=0x149900000c58, table_list=0x1499000107f8, ot_ctx=0x14993555caa0) at /test/mtest/10.10_opt/sql/sql_base.h:561
      #14 0x000055d49b96661a in open_and_process_table (ot_ctx=0x14993555caa0, has_prelocking_list=false, prelocking_strategy=0x14993555cc50, flags=0, counter=0x14993555cb3c, tables=0x1499000107f8, thd=0x149900000c58) at /test/mtest/10.10_opt/sql/sql_base.cc:4087
      #15 open_tables (thd=thd@entry=0x149900000c58, options=@0x1499000061b8: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x14993555cb28, counter=counter@entry=0x14993555cb3c, flags=flags@entry=0, prelocking_strategy=0x14993555cc50) at /test/mtest/10.10_opt/sql/sql_base.cc:4574
      #16 0x000055d49b966dc9 in open_and_lock_tables (thd=thd@entry=0x149900000c58, options=<optimized out>, tables=<optimized out>, tables@entry=0x1499000107f8, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=<optimized out>) at /test/mtest/10.10_opt/sql/sql_base.cc:5547
      #17 0x000055d49b999c1a in open_and_lock_tables (flags=<optimized out>, derived=<optimized out>, tables=<optimized out>, thd=<optimized out>) at /test/mtest/10.10_opt/sql/sql_base.h:510
      #18 open_and_lock_for_insert_delayed (table_list=<optimized out>, thd=<optimized out>) at /test/mtest/10.10_opt/sql/sql_insert.cc:628
      #19 mysql_insert (thd=thd@entry=0x149900000c58, table_list=0x1499000107f8, fields=@0x149900005b70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d49ca544d0 <end_of_list>, last = 0x149900005b70, elements = 0}, <No data fields>}, values_list=@0x149900005bb8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149900011408, last = 0x149900011408, elements = 1}, <No data fields>}, update_fields=@0x149900005ba0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d49ca544d0 <end_of_list>, last = 0x149900005ba0, elements = 0}, <No data fields>}, update_values=@0x149900005b88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d49ca544d0 <end_of_list>, last = 0x149900005b88, elements = 0}, <No data fields>}, duplic=<optimized out>, ignore=<optimized out>, result=<optimized out>) at /test/mtest/10.10_opt/sql/sql_insert.cc:753
      #20 0x000055d49b9d4d60 in mysql_execute_command (thd=0x149900000c58, is_called_from_prepared_stmt=<optimized out>) at /test/mtest/10.10_opt/sql/sql_parse.cc:4562
      #21 0x000055d49b9c5036 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x149900000c58) at /test/mtest/10.10_opt/sql/sql_parse.cc:8036
      #22 mysql_parse (thd=0x149900000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/mtest/10.10_opt/sql/sql_parse.cc:7958
      #23 0x000055d49b9d0bda in dispatch_command (command=COM_QUERY, thd=0x149900000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/mtest/10.10_opt/sql/sql_class.h:1365
      #24 0x000055d49b9d2b18 in do_command (thd=0x149900000c58, blocking=blocking@entry=true) at /test/mtest/10.10_opt/sql/sql_parse.cc:1407
      #25 0x000055d49baea5c7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d49d640d98, put_in_cache=put_in_cache@entry=true) at /test/mtest/10.10_opt/sql/sql_connect.cc:1418
      #26 0x000055d49baea8ad in handle_one_connection (arg=0x55d49d640d98) at /test/mtest/10.10_opt/sql/sql_connect.cc:1312
      #27 0x000014994e3b7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x000014994dfa5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.