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

Assertion `m_tickets[MDL_STATEMENT].is_empty()' failed in MDL_context::set_transaction_duration_for_all_locks

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (c ENUM ('''')) ENGINE=InnoDB;
      LOCK TABLE t WRITE;
      SET sql_mode=strict_all_tables;
      CREATE OR REPLACE TABLE t (a INT) ENGINE=Aria COMMENT=''SELECT'' AS a;
      

      Leads to:

      11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug)

      mariadbd: /test/11.1_dbg/sql/mdl.cc:3261: void MDL_context::set_transaction_duration_for_all_locks(): Assertion `m_tickets[MDL_STATEMENT].is_empty()' failed.
      

      11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug)

      Core was generated by `/test/MD070423-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22428113688128)
          at ./nptl/pthread_kill.c:44
      [Current thread is 1 (Thread 0x1465f3bfd640 (LWP 3787284))]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22428113688128) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=22428113688128) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=22428113688128, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x000014662cb67476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x000014662cb4d7f3 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000014662cb4d71b in __assert_fail_base (fmt=0x14662cd02150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55bd05740338 "m_tickets[MDL_STATEMENT].is_empty()", file=0x55bd0573fd19 "/test/11.1_dbg/sql/mdl.cc", line=3261, function=<optimized out>) at ./assert/assert.c:92
      #6  0x000014662cb5ee96 in __GI___assert_fail (assertion=0x55bd05740338 "m_tickets[MDL_STATEMENT].is_empty()", file=0x55bd0573fd19 "/test/11.1_dbg/sql/mdl.cc", line=3261, function=0x55bd05740db8 "void MDL_context::set_transaction_duration_for_all_locks()") at ./assert/assert.c:101
      #7  0x000055bd04d6e704 in MDL_context::set_transaction_duration_for_all_locks (this=this@entry=0x1465c0000eb0) at /test/11.1_dbg/sql/mdl.cc:3261
      #8  0x000055bd04ba3f60 in THD::leave_locked_tables_mode (this=this@entry=0x1465c0000d58) at /test/11.1_dbg/sql/sql_class.cc:6020
      #9  0x000055bd04b84130 in Locked_tables_list::unlock_locked_tables (this=this@entry=0x1465c0004db8, thd=thd@entry=0x1465c0000d58) at /test/11.1_dbg/sql/sql_base.cc:2595
      #10 0x000055bd04b842a9 in Locked_tables_list::unlock_locked_table (this=0x1465c0004db8, thd=0x1465c0000d58, mdl_ticket=<optimized out>) at /test/11.1_dbg/sql/sql_base.cc:2643
      #11 0x000055bd04bc08f0 in select_create::abort_result_set (this=0x1465c0014a00) at /test/11.1_dbg/sql/sql_insert.cc:5329
      #12 0x000055bd04c93044 in handle_select (thd=thd@entry=0x1465c0000d58, lex=lex@entry=0x1465c0004ec8, result=result@entry=0x1465c0014a00, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.1_dbg/sql/sql_select.cc:629
      #13 0x000055bd04ce2974 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x1465c0000d58) at /test/11.1_dbg/sql/sql_table.cc:12422
      #14 0x000055bd04c09604 in mysql_execute_command (thd=thd@entry=0x1465c0000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.1_dbg/sql/sql_parse.cc:5760
      #15 0x000055bd04c0af05 in mysql_parse (thd=thd@entry=0x1465c0000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1465f3bfc230) at /test/11.1_dbg/sql/sql_parse.cc:7760
      #16 0x000055bd04c0d099 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1465c0000d58, packet=packet@entry=0x1465c000ae49 "CREATE OR REPLACE TABLE t (a INT) ENGINE=Aria COMMENT=''SELECT'' AS a", packet_length=packet_length@entry=69, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_class.h:242
      #17 0x000055bd04c0eef5 in do_command (thd=0x1465c0000d58, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_parse.cc:1405
      #18 0x000055bd04d60cfc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55bd08081e98, put_in_cache=put_in_cache@entry=true) at /test/11.1_dbg/sql/sql_connect.cc:1416
      #19 0x000055bd04d60f5b in handle_one_connection (arg=0x55bd08081e98) at /test/11.1_dbg/sql/sql_connect.cc:1318
      #20 0x000014662cbb9b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #21 0x000014662cc4ba00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Bug confirmed present in:
      MariaDB: 10.6.13 (dbg), 10.7.8 (dbg), 10.8.8 (dbg), 10.9.6 (dbg), 10.10.4 (dbg), 10.11.3 (dbg), 11.0.2 (dbg), 11.1.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.29 (dbg), 10.4.29 (opt), 10.5.20 (dbg), 10.5.20 (opt), 10.6.13 (opt), 10.7.8 (opt), 10.8.8 (opt), 10.9.6 (opt), 10.10.4 (opt), 10.11.3 (opt), 11.0.2 (opt), 11.1.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 5.7.40 (opt), 8.0.31 (dbg), 8.0.31 (opt)

      Attachments

        Activity

          People

            monty Michael Widenius
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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