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

Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

    XMLWordPrintable

Details

    Description

      USE test;
      CREATE TEMPORARY TABLE t (c INT);
      LOCK TABLE t WRITE;
      DROP SEQUENCE IF EXISTS t;
      

      Leads to:

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b

      mysqld: /test/10.5_dbg/sql/sql_table.cc:2396: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)' failed.
      

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b

      Core was generated by `/test/MD140720-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x1515df246700 (LWP 1424019))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055676f2f74d7 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x000055676eab19ba in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00001515dd4dc8b1 in __GI_abort () at abort.c:79
      #6  0x00001515dd4cc42a in __assert_fail_base (fmt=0x1515dd653a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55676f490a20 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)", file=file@entry=0x55676f490208 "/test/10.5_dbg/sql/sql_table.cc", line=line@entry=2396, function=function@entry=0x55676f493160 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool)") at assert.c:92
      #7  0x00001515dd4cc4a2 in __GI___assert_fail (assertion=assertion@entry=0x55676f490a20 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)", file=file@entry=0x55676f490208 "/test/10.5_dbg/sql/sql_table.cc", line=line@entry=2396, function=function@entry=0x55676f493160 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool)") at assert.c:101
      #8  0x000055676e8c881a in mysql_rm_table_no_locks (thd=thd@entry=0x1515bac15088, tables=tables@entry=0x1515bac74170, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=false, drop_view=drop_view@entry=false, drop_sequence=drop_sequence@entry=true, dont_log_query=false, dont_free_locks=false) at /test/10.5_dbg/sql/sql_table.cc:2395
      #9  0x000055676e8caa03 in mysql_rm_table (thd=thd@entry=0x1515bac15088, tables=tables@entry=0x1515bac74170, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false) at /test/10.5_dbg/sql/sql_table.cc:2143
      #10 0x000055676e808307 in mysql_execute_command (thd=thd@entry=0x1515bac15088) at /test/10.5_dbg/sql/sql_parse.cc:4921
      #11 0x000055676e812752 in mysql_parse (thd=thd@entry=0x1515bac15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1515df245350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7993
      #12 0x000055676e7ff204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1515bac15088, packet=packet@entry=0x1515bac67089 "DROP SEQUENCE IF EXISTS t", packet_length=packet_length@entry=25, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1866
      #13 0x000055676e7fd9de in do_command (thd=0x1515bac15088) at /test/10.5_dbg/sql/sql_parse.cc:1347
      #14 0x000055676e959c3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x1515be0c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #15 0x000055676e95a357 in handle_one_connection (arg=arg@entry=0x1515be0c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #16 0x000055676edbdca8 in pfs_spawn_thread (arg=0x1515dc046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #17 0x00001515de1bf6db in start_thread (arg=0x1515df246700) at pthread_create.c:463
      #18 0x00001515dd5bda3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.24 (dbg), 10.4.14 (dbg), 10.5.5 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.5 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      DROP SEQUENCE not available in 10.2, so not a regression.

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              Roel Roel Van de Paar
              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.