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

Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      CREATE TEMPORARY TABLE tmp (b INT);
      LOCK TABLE t1 READ;
      --error ER_UNKNOWN_SEQUENCES
      DROP SEQUENCE tmp;
       
      # Cleanup
      UNLOCK TABLES;
      DROP TABLE t1;
      

      10.3 a2335b79

      mysqld: /data/src/10.3/sql/sql_table.cc:2395: 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, table->db.str, table->table_name.str, MDL_SHARED)' failed.
      190417 19:02:21 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f1437b17ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000562c267cde8c in mysql_rm_table_no_locks (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2393
      #9  0x0000562c267cd494 in mysql_rm_table (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_sequence=true) at /data/src/10.3/sql/sql_table.cc:2124
      #10 0x0000562c26706f53 in mysql_execute_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:5055
      #11 0x0000562c26710781 in mysql_parse (thd=0x7f1420000b00, rawbuf=0x7f1420014ce8 "DROP SEQUENCE tmp", length=17, parser_state=0x7f1431cbe5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
      #12 0x0000562c266fda50 in dispatch_command (command=COM_QUERY, thd=0x7f1420000b00, packet=0x7f142000b1f1 "DROP SEQUENCE tmp", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #13 0x0000562c266fc43a in do_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #14 0x0000562c2686503d in do_handle_one_connection (connect=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1402
      #15 0x0000562c26864dc1 in handle_one_connection (arg=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #16 0x0000562c26d016a3 in pfs_spawn_thread (arg=0x562c28fe3f50) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #17 0x00007f1439c0c494 in start_thread (arg=0x7f1431cbf700) at pthread_create.c:333
      #18 0x00007f1437bd493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No obvious problems on a non-debug build with the test case above, but here is another one which does cause a crash on a non-debug build (and the same assertion failure on a debug build):

      CREATE TABLE t (a INT);
      CREATE TEMPORARY TABLE s (f INT);
      CREATE SEQUENCE s;
      LOCK TABLE t WRITE;
      DROP SEQUENCE s;
       
      # Cleanup
      UNLOCK TABLES;
      DROP TABLE t;
      

      10.3 a2335b79 non-debug

      #2  <signal handler called>
      #3  0x000055ca45f79e0c in MDL_ticket::has_stronger_or_equal_type (this=this@entry=0x0, type=type@entry=MDL_EXCLUSIVE) at /data/src/10.3/sql/mdl.cc:1720
      #4  0x000055ca45f7bd60 in MDL_context::upgrade_shared_lock (this=this@entry=0x7f3670000ac8, mdl_ticket=0x0, new_type=new_type@entry=MDL_EXCLUSIVE, lock_wait_timeout=86400) at /data/src/10.3/sql/mdl.cc:2330
      #5  0x000055ca45e3ede5 in wait_while_table_is_used (thd=thd@entry=0x7f36700009a8, table=0x7f367006bf78, function=function@entry=HA_EXTRA_NOT_USED) at /data/src/10.3/sql/sql_base.cc:1246
      #6  0x000055ca45f1aeb7 in mysql_rm_table_no_locks (thd=0x7f36700009a8, tables=<optimized out>, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_view=<optimized out>, drop_sequence=<optimized out>, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2487
      #7  0x000055ca45f1c055 in mysql_rm_table (thd=0x7f36700009a8, tables=0x7f3670011758, if_exists=false, drop_temporary=3, drop_sequence=false) at /data/src/10.3/sql/sql_table.cc:2124
      #8  0x000055ca45e992fb in mysql_execute_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:5055
      #9  0x000055ca45e9d8e1 in mysql_parse (thd=0x7f36700009a8, rawbuf=<optimized out>, length=15, parser_state=0x7f368139f630, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.3/sql/sql_parse.cc:8091
      #10 0x000055ca45ea0028 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f36700009a8, packet=packet@entry=0x7f3670009329 "DROP SEQUENCE s", packet_length=packet_length@entry=15, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #11 0x000055ca45ea09e0 in do_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:1403
      #12 0x000055ca45f73994 in do_handle_one_connection (connect=connect@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1402
      #13 0x000055ca45f73b34 in handle_one_connection (arg=arg@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1308
      #14 0x000055ca46258614 in pfs_spawn_thread (arg=0x55ca4908a168) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #15 0x00007f36892ef494 in start_thread (arg=0x7f36813a0700) at pthread_create.c:333
      #16 0x00007f36872b793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.