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

Assertion `table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_mroonga';
      CREATE TABLE t (c INT AUTO_INCREMENT KEY) ENGINE=Mroonga;
      LOCK TABLES t WRITE;
      INSERT INTO t VALUES (1);
      

      Leads to:

      CS 13.2.0 c894d97781b54fbf074677c9d67f81cd60a162ac (Debug, Clang 22.1.8-20260621) Build 26/10/2026

      mariadbd: /test/13.1_dbg/sql/handler.cc:8139: int handler::ha_external_lock(THD *, int): Assertion `table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)' failed.
      

      CS 13.2.0 c894d97781b54fbf074677c9d67f81cd60a162ac (Debug, Clang 22.1.8-20260621) Build 26/10/2026

      Core was generated by `/test/MD261026-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3005402)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x00007cbf0324527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007cbf032288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007cbf0322881b in __assert_fail_base (fmt=0x7cbf033d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5fee00bc8fac "table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)", file=file@entry=0x5fee00bc6a48 "/test/13.1_dbg/sql/handler.cc", line=line@entry=8139, function=function@entry=0x5fee00bc8f0d "int handler::ha_external_lock(THD *, int)") at ./assert/assert.c:96
      #6  0x00007cbf0323b517 in __assert_fail (assertion=0x5fee00bc8fac "table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)", file=0x5fee00bc6a48 "/test/13.1_dbg/sql/handler.cc", line=8139, function=0x5fee00bc8f0d "int handler::ha_external_lock(THD *, int)")at ./assert/assert.c:105
      #7  0x00005fedfff366cc in handler::ha_external_lock (this=0x74be0d7003f0, thd=0x74be0c000d60, lock_type=0) at /test/13.1_dbg/sql/handler.cc:8137
      #8  0x000074bebd10ab4d in mrn::ExternalLock::ExternalLock (this=0x7cbf001ae818, thd=0x74be0c000d60, handler=0x74be0d7003f0, lock_type=0) at /test/13.1_dbg/storage/mroonga/lib/mrn_external_lock.cpp:28
      #9  0x000074bebd0c6a98 in ha_mroonga::storage_info (this=0x74be0d7003f0, flag=64) at /test/13.1_dbg/storage/mroonga/ha_mroonga.cpp:5297
      #10 0x000074bebd0cc6f4 in ha_mroonga::storage_write_row (this=0x74be0d7003f0, buf=0x74be0d701bd0 "\377\001")at /test/13.1_dbg/storage/mroonga/ha_mroonga.cpp:6213
      #11 0x000074bebd0cdfb3 in ha_mroonga::write_row (this=0x74be0d7003f0, buf=0x74be0d701bd0 "\377\001")at /test/13.1_dbg/storage/mroonga/ha_mroonga.cpp:6464
      #12 0x00005fedfff438d0 in handler::ha_write_row (this=0x74be0d7003f0, buf=0x74be0d701bd0 "\377\001") at /test/13.1_dbg/sql/handler.cc:8667
      #13 0x00005fedffab9b82 in Write_record::single_insert (this=0x7cbf001b2e70, inserted=0x7cbf001b2970) at /test/13.1_dbg/sql/sql_insert.cc:2396
      #14 0x00005fedffab7bd3 in Write_record::write_record (this=0x7cbf001b2e70)at /test/13.1_dbg/sql/sql_insert.cc:2438
      #15 0x00005fedffab545b in mysql_insert (thd=0x74be0c000d60, table_list=0x74be0c01a560, fields=@0x74be0c0062d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5fee01830230 <end_of_list>, last = 0x74be0c0062d0, elements = 0}, <No data fields>}, values_list=@0x74be0c006318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x74be0c01b290, last = 0x74be0c01b290, elements = 1}, <No data fields>}, update_fields=@0x74be0c006300: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5fee01830230 <end_of_list>, last = 0x74be0c006300, elements = 0}, <No data fields>}, update_values=@0x74be0c0062e8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5fee01830230 <end_of_list>, last = 0x74be0c0062e8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/13.1_dbg/sql/sql_insert.cc:1232
      #16 0x00005fedffb1ca83 in mysql_execute_command (thd=0x74be0c000d60, is_called_from_prepared_stmt=false) at /test/13.1_dbg/sql/sql_parse.cc:4549
      #17 0x00005fedffb13718 in mysql_parse (thd=0x74be0c000d60, rawbuf=0x74be0c01a460 "INSERT INTO t VALUES (1)", length=24, parser_state=0x7cbf001b49c0) at /test/13.1_dbg/sql/sql_parse.cc:8005
      #18 0x00005fedffb10ece in dispatch_command (command=COM_QUERY, thd=0x74be0c000d60, packet=0x74be0c00b691 "INSERT INTO t VALUES (1)", packet_length=24, blocking=true) at /test/13.1_dbg/sql/sql_parse.cc:1903
      #19 0x00005fedffb1419a in do_command (thd=0x74be0c000d60, blocking=true)at /test/13.1_dbg/sql/sql_parse.cc:1437
      #20 0x00005fedffcef0ce in do_handle_one_connection (connect=0x5fee1c1d6f40, put_in_cache=true) at /test/13.1_dbg/sql/sql_connect.cc:1514
      #21 0x00005fedffceeeb1 in handle_one_connection (arg=0x5fee1c16f8f0)at /test/13.1_dbg/sql/sql_connect.cc:1426
      #22 0x00007cbf0329cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x00007cbf03329ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  261026  6a063120d4d3d451bff3ea84b3ffbee288b33be8  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  10.11  opt  261026  6a063120d4d3d451bff3ea84b3ffbee288b33be8  No bug found                  
      CS  11.4   dbg  261026  b6406d42c8e26be3d86a4a743180f6b415a4559b  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  11.4   opt  261026  b6406d42c8e26be3d86a4a743180f6b415a4559b  No bug found                  
      CS  11.8   dbg  261026  274dd0d8d90bc773090d13303b8d5e36d2390241  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  11.8   opt  261026  274dd0d8d90bc773090d13303b8d5e36d2390241  No bug found                  
      CS  12.3   dbg  261026  788a07c52132d9f42b6991e599510c62d1625c0f  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  12.3   opt  261026  788a07c52132d9f42b6991e599510c62d1625c0f  No bug found                  
      CS  13.0   dbg  261026  620a4b5624222048fece7fe1789978ae0675cae2  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  13.0   opt  261026  620a4b5624222048fece7fe1789978ae0675cae2  No bug found                  
      CS  13.2   dbg  261026  c894d97781b54fbf074677c9d67f81cd60a162ac  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  13.2   opt  261026  c894d97781b54fbf074677c9d67f81cd60a162ac  No bug found                  
      ES  10.6   dbg  261026  45fbb1583d8cdcc7da5a123a844b3bf512f31c9d  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  10.6   opt  261026  45fbb1583d8cdcc7da5a123a844b3bf512f31c9d  No bug found                  
      ES  11.4   dbg  261026  6b2ae48e6e2488060adfdd02a7114bb60d4d150c  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  11.4   opt  261026  6b2ae48e6e2488060adfdd02a7114bb60d4d150c  No bug found                  
      ES  11.8   dbg  261026  6e6ba60bdc2b3f478513c5afa3faa062d8e73736  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  11.8   opt  261026  6e6ba60bdc2b3f478513c5afa3faa062d8e73736  No bug found                  
      ES  12.3   dbg  261026  781803ca9943d806ecb4b3b3fb39264dfafe1cf0  table_share->tmp_table != NO_TMP_TABLE || ((lock_type != 2 && m_lock_type == 2) || lock_type == 2)|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  12.3   opt  261026  781803ca9943d806ecb4b3b3fb39264dfafe1cf0  No bug found                  
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.15d
                0.15d

                Git Integration

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