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

Assertion `(create_info->tmp_table()) || thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_EXCLUSIVE)' failed in mysql_create_like_table

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      CREATE TABLE t2 (b INT);
      CREATE VIEW v2 AS SELECT * FROM t2 ;
       
      LOCK TABLES t1 WRITE, v2 WRITE;
      CREATE TABLE IF NOT EXISTS t1 LIKE t2;
       
      # Cleanup
      UNLOCK TABLES;
      DROP VIEW v2;
      DROP TABLE t1, t2;
      

      10.4 a2e477ff

      mysqld: /data/src/10.4/sql/sql_table.cc:5723: bool mysql_create_like_table(THD*, TABLE_LIST*, TABLE_LIST*, Table_specification_st*): Assertion `(create_info->tmp_table()) || thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_EXCLUSIVE)' failed.
      190406 13:33:08 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fd201d73ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000562bc1f80412 in mysql_create_like_table (thd=0x7fd1e0000b00, table=0x7fd1e00156e0, src_table=0x7fd1e0015dc8, create_info=0x7fd1fc6ed910) at /data/src/10.4/sql/sql_table.cc:5720
      #9  0x0000562bc1ea3d66 in mysql_execute_command (thd=0x7fd1e0000b00) at /data/src/10.4/sql/sql_parse.cc:4376
      #10 0x0000562bc1eb1171 in mysql_parse (thd=0x7fd1e0000b00, rawbuf=0x7fd1e00155e8 "CREATE TABLE IF NOT EXISTS t1 LIKE t2", length=37, parser_state=0x7fd1fc6ee180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8154
      #11 0x0000562bc1e9cbc8 in dispatch_command (command=COM_QUERY, thd=0x7fd1e0000b00, packet=0x7fd1e000a8a1 "CREATE TABLE IF NOT EXISTS t1 LIKE t2", packet_length=37, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1832
      #12 0x0000562bc1e9b3ae in do_command (thd=0x7fd1e0000b00) at /data/src/10.4/sql/sql_parse.cc:1365
      #13 0x0000562bc20137a5 in do_handle_one_connection (connect=0x562bc5aab520) at /data/src/10.4/sql/sql_connect.cc:1398
      #14 0x0000562bc2013516 in handle_one_connection (arg=0x562bc5aab520) at /data/src/10.4/sql/sql_connect.cc:1301
      #15 0x0000562bc2507995 in pfs_spawn_thread (arg=0x562bc5b9d8f0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #16 0x00007fd203c62494 in start_thread (arg=0x7fd1fc6ef700) at pthread_create.c:333
      #17 0x00007fd201e3093f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Slightly different on 10.1-10.2:

      10.2 b4a7bde76

      mysqld: /data/src/10.2/sql/sql_table.cc:5516: bool mysql_create_like_table(THD*, TABLE_LIST*, TABLE_LIST*, Table_specification_st*): Assertion `(create_info->tmp_table()) || thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_EXCLUSIVE)' failed.
      190406 13:35:10 [ERROR] mysqld got signal 6 ;
      

      Yet slightly different on 5.5:

      5.5 370886a9

      mysqld: /data/src/5.5/sql/sql_table.cc:4887: bool mysql_create_like_table(THD*, TABLE_LIST*, TABLE_LIST*, HA_CREATE_INFO*): Assertion `(create_info->options & 1) || thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_EXCLUSIVE)' failed.
      

      No obvious problem on a non-debug build.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.