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

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

Details

    • 10.2.4-3

    Description

      Stack trace from 10.2 54b81ac57f89c

      mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
      160913  1:24:05 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f1435e34266 in __assert_fail_base (fmt=0x7f1435f6d238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f143901bc50 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f143901b1d8 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f143901d080 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
      #7  0x00007f1435e34312 in __GI___assert_fail (assertion=0x7f143901bc50 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f143901b1d8 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f143901d080 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
      #8  0x00007f143876de6f in mysql_rm_table_no_locks (thd=0x7f142d016070, tables=0x7f142d064198, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
      #9  0x00007f143876d5c9 in mysql_rm_table (thd=0x7f142d016070, tables=0x7f142d064198, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
      #10 0x00007f14386bb55a in mysql_execute_command (thd=0x7f142d016070) at /data/src/10.2/sql/sql_parse.cc:4639
      #11 0x00007f14386c518b in mysql_parse (thd=0x7f142d016070, rawbuf=0x7f142d064088 "DROP TABLE nonexisting_table, t1", length=32, parser_state=0x7f1439614dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
      #12 0x00007f14386b3579 in dispatch_command (command=COM_QUERY, thd=0x7f142d016070, packet=0x7f142d058071 "DROP TABLE nonexisting_table, t1", packet_length=32, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
      #13 0x00007f14386b1faa in do_command (thd=0x7f142d016070) at /data/src/10.2/sql/sql_parse.cc:1365
      #14 0x00007f14387ed936 in do_handle_one_connection (connect=0x7f143546d410) at /data/src/10.2/sql/sql_connect.cc:1354
      #15 0x00007f14387ed6c3 in handle_one_connection (arg=0x7f143546d410) at /data/src/10.2/sql/sql_connect.cc:1260
      #16 0x00007f1438afbef2 in pfs_spawn_thread (arg=0x7f14354519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #17 0x00007f1437d360a4 in start_thread (arg=0x7f1439616300) at pthread_create.c:309
      #18 0x00007f1435eee87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      CREATE TEMPORARY TABLE t1 (i INT);
      --error ER_BAD_TABLE_ERROR
      DROP TABLE nonexisting_table, t1;
      

      The problem apparently appeared in 10.2 tree with this revision:

      commit 7305be2f7e724e5e62961606794beab199d79045
      Author: Nirbhay Choubey <nirbhay@mariadb.com>
      Date:   Fri Jun 10 16:19:59 2016 -0400
       
          MDEV-5535: Cannot reopen temporary table
          
          mysqld maintains a list of TABLE objects for all temporary
          tables created within a session in THD. Here each table is
          represented by a TABLE object.
          
          A query referencing a particular temporary table for more
          than once, however, failed with ER_CANT_REOPEN_TABLE error
          because a TABLE_SHARE was allocate together with the TABLE,
          so temporary tables always had only one TABLE per TABLE_SHARE.
          
          This patch lift this restriction by separating TABLE and
          TABLE_SHARE objects and storing TABLE_SHAREs for temporary
          tables in a list in THD, and TABLEs in a list within their
          respective TABLE_SHAREs.
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Description {noformat:title=Stack trace from 10.2 22d8d863bab3}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160911 23:18:33 [ERROR] mysqld got signal 6 ;

            #5 0x00007f4d4dc42448 in __GI_abort () at abort.c:89
            #6 0x00007f4d4dc3a266 in __assert_fail_base (fmt=0x7f4d4dd73238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f4d4dc3a312 in __GI___assert_fail (assertion=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f4d50573dbb in mysql_rm_table_no_locks (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f4d50573515 in mysql_rm_table (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f4d504c14a6 in mysql_execute_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f4d504cb0d7 in mysql_parse (thd=0x7f4d21016070, rawbuf=0x7f4d21063088 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */", length=91, parser_state=0x7f4d513abe20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f4d504b94c5 in dispatch_command (command=COM_QUERY, thd=0x7f4d21016070, packet=0x7f4d21054071 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */ ", packet_length=92, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f4d504b7ef6 in do_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f4d505f37ba in do_handle_one_connection (connect=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f4d505f3547 in handle_one_connection (arg=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f4d4fb3c0a4 in start_thread (arg=0x7f4d513ad300) at pthread_create.c:309
            #17 0x00007f4d4dcf487d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {noformat}
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f4d21063088): DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */
            Connection ID (thread ID): 10
            Status: NOT_KILLED
            {noformat}

            {noformat}
            perl ./runall-new.pl --no-mask --seed=1473250770 --threads=1 --duration=900 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --validators=TransformerNoComparator --transformers=ExecuteAsUnion --grammar=mdev10779-2.yy --gendata=conf/runtime/concurrency_1.zz --mtr-build-thread=300 --basedir1=/data/bld/10.2 --vardir1=/data/logs/analyze6b
            {noformat}
            {noformat:title=Stack trace from 10.2 22d8d863bab3}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160911 23:18:33 [ERROR] mysqld got signal 6 ;

            #5 0x00007f4d4dc42448 in __GI_abort () at abort.c:89
            #6 0x00007f4d4dc3a266 in __assert_fail_base (fmt=0x7f4d4dd73238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f4d4dc3a312 in __GI___assert_fail (assertion=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f4d50573dbb in mysql_rm_table_no_locks (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f4d50573515 in mysql_rm_table (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f4d504c14a6 in mysql_execute_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f4d504cb0d7 in mysql_parse (thd=0x7f4d21016070, rawbuf=0x7f4d21063088 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */", length=91, parser_state=0x7f4d513abe20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f4d504b94c5 in dispatch_command (command=COM_QUERY, thd=0x7f4d21016070, packet=0x7f4d21054071 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */ ", packet_length=92, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f4d504b7ef6 in do_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f4d505f37ba in do_handle_one_connection (connect=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f4d505f3547 in handle_one_connection (arg=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f4d4fb3c0a4 in start_thread (arg=0x7f4d513ad300) at pthread_create.c:309
            #17 0x00007f4d4dcf487d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {noformat}
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f4d21063088): DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */
            Connection ID (thread ID): 10
            Status: NOT_KILLED
            {noformat}

            {noformat}
            perl ./runall-new.pl --no-mask --seed=1473250770 --threads=1 --duration=900 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --validators=TransformerNoComparator --transformers=ExecuteAsUnion --grammar=mdev10779-2.yy --gendata=conf/runtime/concurrency_1.zz --mtr-build-thread=300 --basedir1=/data/bld/10.2 --vardir1=/data/logs/analyze6b
            {noformat}

            RQG 22d8d863bab (experimental branch)
            elenst Elena Stepanova made changes -
            Description {noformat:title=Stack trace from 10.2 22d8d863bab3}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160911 23:18:33 [ERROR] mysqld got signal 6 ;

            #5 0x00007f4d4dc42448 in __GI_abort () at abort.c:89
            #6 0x00007f4d4dc3a266 in __assert_fail_base (fmt=0x7f4d4dd73238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f4d4dc3a312 in __GI___assert_fail (assertion=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f4d50573dbb in mysql_rm_table_no_locks (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f4d50573515 in mysql_rm_table (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f4d504c14a6 in mysql_execute_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f4d504cb0d7 in mysql_parse (thd=0x7f4d21016070, rawbuf=0x7f4d21063088 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */", length=91, parser_state=0x7f4d513abe20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f4d504b94c5 in dispatch_command (command=COM_QUERY, thd=0x7f4d21016070, packet=0x7f4d21054071 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */ ", packet_length=92, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f4d504b7ef6 in do_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f4d505f37ba in do_handle_one_connection (connect=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f4d505f3547 in handle_one_connection (arg=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f4d4fb3c0a4 in start_thread (arg=0x7f4d513ad300) at pthread_create.c:309
            #17 0x00007f4d4dcf487d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {noformat}
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f4d21063088): DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */
            Connection ID (thread ID): 10
            Status: NOT_KILLED
            {noformat}

            {noformat}
            perl ./runall-new.pl --no-mask --seed=1473250770 --threads=1 --duration=900 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --validators=TransformerNoComparator --transformers=ExecuteAsUnion --grammar=mdev10779-2.yy --gendata=conf/runtime/concurrency_1.zz --mtr-build-thread=300 --basedir1=/data/bld/10.2 --vardir1=/data/logs/analyze6b
            {noformat}

            RQG 22d8d863bab (experimental branch)
            {noformat:title=Stack trace from 10.2 1168e2fa54d2b77b}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160911 23:18:33 [ERROR] mysqld got signal 6 ;

            #5 0x00007f4d4dc42448 in __GI_abort () at abort.c:89
            #6 0x00007f4d4dc3a266 in __assert_fail_base (fmt=0x7f4d4dd73238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f4d4dc3a312 in __GI___assert_fail (assertion=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f4d50573dbb in mysql_rm_table_no_locks (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f4d50573515 in mysql_rm_table (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f4d504c14a6 in mysql_execute_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f4d504cb0d7 in mysql_parse (thd=0x7f4d21016070, rawbuf=0x7f4d21063088 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */", length=91, parser_state=0x7f4d513abe20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f4d504b94c5 in dispatch_command (command=COM_QUERY, thd=0x7f4d21016070, packet=0x7f4d21054071 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */ ", packet_length=92, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f4d504b7ef6 in do_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f4d505f37ba in do_handle_one_connection (connect=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f4d505f3547 in handle_one_connection (arg=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f4d4fb3c0a4 in start_thread (arg=0x7f4d513ad300) at pthread_create.c:309
            #17 0x00007f4d4dcf487d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {noformat}
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f4d21063088): DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */
            Connection ID (thread ID): 10
            Status: NOT_KILLED
            {noformat}

            {noformat}
            perl ./runall-new.pl --no-mask --seed=1473250770 --threads=1 --duration=900 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --validators=TransformerNoComparator --transformers=ExecuteAsUnion --grammar=mdev10779-2.yy --gendata=conf/runtime/concurrency_1.zz --mtr-build-thread=300 --basedir1=/data/bld/10.2 --vardir1=/data/logs/analyze6b
            {noformat}

            RQG 22d8d863bab (experimental branch)
            elenst Elena Stepanova made changes -
            Component/s Data Definition - Temporary [ 10123 ]
            Component/s Locking [ 10900 ]
            Fix Version/s 10.2 [ 14601 ]
            Assignee Elena Stepanova [ elenst ] Nirbhay Choubey [ nirbhay_c ]
            Description {noformat:title=Stack trace from 10.2 1168e2fa54d2b77b}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160911 23:18:33 [ERROR] mysqld got signal 6 ;

            #5 0x00007f4d4dc42448 in __GI_abort () at abort.c:89
            #6 0x00007f4d4dc3a266 in __assert_fail_base (fmt=0x7f4d4dd73238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f4d4dc3a312 in __GI___assert_fail (assertion=0x7f4d50e21890 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f4d50e20e18 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f4d50e22cc0 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f4d50573dbb in mysql_rm_table_no_locks (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f4d50573515 in mysql_rm_table (thd=0x7f4d21016070, tables=0x7f4d21063210, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f4d504c14a6 in mysql_execute_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f4d504cb0d7 in mysql_parse (thd=0x7f4d21016070, rawbuf=0x7f4d21063088 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */", length=91, parser_state=0x7f4d513abe20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f4d504b94c5 in dispatch_command (command=COM_QUERY, thd=0x7f4d21016070, packet=0x7f4d21054071 "DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */ ", packet_length=92, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f4d504b7ef6 in do_command (thd=0x7f4d21016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f4d505f37ba in do_handle_one_connection (connect=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f4d505f3547 in handle_one_connection (arg=0x7f4d4d45cc90) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f4d4fb3c0a4 in start_thread (arg=0x7f4d513ad300) at pthread_create.c:309
            #17 0x00007f4d4dcf487d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {noformat}
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f4d21063088): DROP TABLE testdb_S.t1_merge2_N, testdb_N.t1_temp1_N RESTRICT /* QUERY_NO 2001 CON_ID 10 */
            Connection ID (thread ID): 10
            Status: NOT_KILLED
            {noformat}

            {noformat}
            perl ./runall-new.pl --no-mask --seed=1473250770 --threads=1 --duration=900 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --validators=TransformerNoComparator --transformers=ExecuteAsUnion --grammar=mdev10779-2.yy --gendata=conf/runtime/concurrency_1.zz --mtr-build-thread=300 --basedir1=/data/bld/10.2 --vardir1=/data/logs/analyze6b
            {noformat}

            RQG 22d8d863bab (experimental branch)
            {noformat:title=Stack trace from 10.2 54b81ac57f89c}
            mysqld: /data/src/10.2/sql/sql_table.cc:2359: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed.
            160913 1:24:05 [ERROR] mysqld got signal 6 ;

            #6 0x00007f1435e34266 in __assert_fail_base (fmt=0x7f1435f6d238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f143901bc50 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=file@entry=0x7f143901b1d8 "/data/src/10.2/sql/sql_table.cc", line=line@entry=2359, function=function@entry=0x7f143901d080 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:92
            #7 0x00007f1435e34312 in __GI___assert_fail (assertion=0x7f143901bc50 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x7f143901b1d8 "/data/src/10.2/sql/sql_table.cc", line=2359, function=0x7f143901d080 <mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)::__PRETTY_FUNCTION__> "int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool)") at assert.c:101
            #8 0x00007f143876de6f in mysql_rm_table_no_locks (thd=0x7f142d016070, tables=0x7f142d064198, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false, dont_free_locks=false) at /data/src/10.2/sql/sql_table.cc:2357
            #9 0x00007f143876d5c9 in mysql_rm_table (thd=0x7f142d016070, tables=0x7f142d064198, if_exists=0 '\000', drop_temporary=0 '\000') at /data/src/10.2/sql/sql_table.cc:2090
            #10 0x00007f14386bb55a in mysql_execute_command (thd=0x7f142d016070) at /data/src/10.2/sql/sql_parse.cc:4639
            #11 0x00007f14386c518b in mysql_parse (thd=0x7f142d016070, rawbuf=0x7f142d064088 "DROP TABLE nonexisting_table, t1", length=32, parser_state=0x7f1439614dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
            #12 0x00007f14386b3579 in dispatch_command (command=COM_QUERY, thd=0x7f142d016070, packet=0x7f142d058071 "DROP TABLE nonexisting_table, t1", packet_length=32, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
            #13 0x00007f14386b1faa in do_command (thd=0x7f142d016070) at /data/src/10.2/sql/sql_parse.cc:1365
            #14 0x00007f14387ed936 in do_handle_one_connection (connect=0x7f143546d410) at /data/src/10.2/sql/sql_connect.cc:1354
            #15 0x00007f14387ed6c3 in handle_one_connection (arg=0x7f143546d410) at /data/src/10.2/sql/sql_connect.cc:1260
            #16 0x00007f1438afbef2 in pfs_spawn_thread (arg=0x7f14354519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
            #17 0x00007f1437d360a4 in start_thread (arg=0x7f1439616300) at pthread_create.c:309
            #18 0x00007f1435eee87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {code:sql}
            CREATE TEMPORARY TABLE t1 (i INT);
            --error ER_BAD_TABLE_ERROR
            DROP TABLE nonexisting_table, t1;
            {code}

            The problem apparently appeared in 10.2 tree with this revision:
            {noformat}
            commit 7305be2f7e724e5e62961606794beab199d79045
            Author: Nirbhay Choubey <nirbhay@mariadb.com>
            Date: Fri Jun 10 16:19:59 2016 -0400

                MDEV-5535: Cannot reopen temporary table
                
                mysqld maintains a list of TABLE objects for all temporary
                tables created within a session in THD. Here each table is
                represented by a TABLE object.
                
                A query referencing a particular temporary table for more
                than once, however, failed with ER_CANT_REOPEN_TABLE error
                because a TABLE_SHARE was allocate together with the TABLE,
                so temporary tables always had only one TABLE per TABLE_SHARE.
                
                This patch lift this restriction by separating TABLE and
                TABLE_SHARE objects and storing TABLE_SHAREs for temporary
                tables in a list in THD, and TABLEs in a list within their
                respective TABLE_SHAREs.
            {noformat}
            Summary [Draft] Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed in int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool) Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed in mysql_rm_table_no_locks
            elenst Elena Stepanova made changes -
            Attachment redefine_random_keys.yy [ 42516 ]
            elenst Elena Stepanova made changes -
            Attachment mdev10779-2.yy [ 42514 ]
            elenst Elena Stepanova made changes -
            Attachment concurrency_1.zz [ 42515 ]
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.4-3 [ 115 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked lower
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            Fix Version/s 10.2.3 [ 22115 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            nirbhay_c Nirbhay Choubey (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 77033 ] MariaDB v4 [ 150908 ]

            People

              nirbhay_c Nirbhay Choubey (Inactive)
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.