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

Assertion `!memcmp(trx_id->data, reset_trx_id, 6)' failed in btr_cur_optimistic_insert on CREATE GTT

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Maintenance, Q1/2026 Server Maintenance

    Description

      CREATE GLOBAL TEMPORARY TABLE t (x INT) ON COMMIT PRESERVE ROWS;
      SET pseudo_thread_id=1;
      INSERT INTO t VALUES (1);
      SET pseudo_thread_id=0;
      DROP TABLE t;
      SET pseudo_thread_id=1;
      CREATE GLOBAL TEMPORARY TABLE t (x INT) ON COMMIT PRESERVE ROWS SELECT 1 QUERY;
      

      Leads, on debug builds, to:

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, Clang 21.1.3-20250923) Build 14/10/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/btr/btr0cur.cc:2478: dberr_t btr_cur_optimistic_insert(ulint, btr_cur_t *, rec_offs **, mem_heap_t **, dtuple_t *, rec_t **, big_rec_t **, ulint, que_thr_t *, mtr_t *): Assertion `!memcmp(trx_id->data, reset_trx_id, 6)' failed.
      

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, Clang 21.1.3-20250923) Build 14/10/2025

      Core was generated by `/test/MDEV-35915_7_MD141025-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-d'.
      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 2221003)]
      (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  0x00007aa0e744526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007aa0e74288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007aa0e742881b in __assert_fail_base (fmt=0x7aa0e75d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5b5ef9d2bfed "!memcmp(trx_id->data, reset_trx_id, 6)", file=file@entry=0x5b5ef9ce5ea4 "/test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/btr/btr0cur.cc", line=line@entry=2478, function=function@entry=0x5b5ef9cf3f53 "dberr_t btr_cur_optimistic_insert(ulint, btr_cur_t *, rec_offs **, mem_heap_t **, dtuple_t *, rec_t **, big_rec_t **, ulint, que_thr_t *, mtr_t *)") at ./assert/assert.c:94
      #6  0x00007aa0e743b507 in __assert_fail (assertion=0x5b5ef9d2bfed "!memcmp(trx_id->data, reset_trx_id, 6)", file=0x5b5ef9ce5ea4 "/test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/btr/btr0cur.cc", line=2478, function=0x5b5ef9cf3f53 "dberr_t btr_cur_optimistic_insert(ulint, btr_cur_t *, rec_offs **, mem_heap_t **, dtuple_t *, rec_t **, big_rec_t **, ulint, que_thr_t *, mtr_t *)") at ./assert/assert.c:103
      #7  0x00005b5efae3cb49 in btr_cur_optimistic_insert (flags=3, cursor=0x7aa0e41af5c8, offsets=0x7aa0e41af348, heap=0x7aa0e41af5a8, entry=0x7a9fb802d358, rec=0x7aa0e41af2c8, big_rec=0x7aa0e41af5b8, n_ext=0, thr=0x7a9fb80373a8, mtr=0x7aa0e41af698)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/btr/btr0cur.cc:2477
      #8  0x00005b5efb0c64f1 in row_ins_clust_index_entry_low (flags=3, mode=BTR_MODIFY_LEAF, index=0x7a9fb802b7b8, n_uniq=0, entry=0x7a9fb802d358, n_ext=0, thr=0x7a9fb80373a8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:2929
      #9  0x00005b5efb0ca5a7 in row_ins_clust_index_entry (index=0x7a9fb802b7b8, entry=0x7a9fb802d358, thr=0x7a9fb80373a8, n_ext=0)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:3315
      #10 0x00005b5efb0d212c in row_ins_index_entry (index=0x7a9fb802b7b8, entry=0x7a9fb802d358, thr=0x7a9fb80373a8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:3455
      #11 0x00005b5efb0d13ed in row_ins_index_entry_step (node=0x7a9fb80371a8, thr=0x7a9fb80373a8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:3621
      #12 0x00005b5efb0cb4a7 in row_ins (node=0x7a9fb80371a8, thr=0x7a9fb80373a8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:3738
      #13 0x00005b5efb0cb17a in row_ins_step (thr=0x7a9fb80373a8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0ins.cc:3867
      #14 0x00005b5efb0f2c26 in row_insert_for_mysql (mysql_rec=0x7a9fb8039278 "\375\001", prebuilt=0x7a9fb8036da8, ins_mode=ROW_INS_NORMAL)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0mysql.cc:1300
      #15 0x00005b5efad98cf5 in ha_innobase::write_row (this=0x7a9fb8038a18, record=0x7a9fb8039278 "\375\001")at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/handler/ha_innodb.cc:7772
      #16 0x00005b5efa471e90 in handler::ha_write_row (this=0x7a9fb8038a18, buf=0x7a9fb8039278 "\375\001")at /test/bb-12.2-nikita-global-tmp_dbg/sql/handler.cc:8244
      #17 0x00005b5efa84bb7b in write_record (thd=0x7a9fb8000d58, table=0x7a9fb8036918, info=0x7a9fb801b998, sink=0x0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_insert.cc:2438
      #18 0x00005b5efa850b09 in select_insert::send_data (this=0x7a9fb801b948, values=@0x7a9fb801ab00: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7a9fb801adb0, last = 0x7a9fb801adb0, elements = 1}, <No data fields>})at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_insert.cc:4452
      #19 0x00005b5efa77344f in select_result_sink::send_data_with_check (this=0x7a9fb801b948, items=@0x7a9fb801ab00: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7a9fb801adb0, last = 0x7a9fb801adb0, elements = 1}, <No data fields>}, u=0x7a9fb8005158, sent=0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_class.cc:3246
      #20 0x00005b5efa92a782 in JOIN::exec_inner (this=0x7a9fb801ba88)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_select.cc:4957
      #21 0x00005b5efa92a229 in JOIN::exec (this=0x7a9fb801ba88)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_select.cc:4874
      #22 0x00005b5efa908653 in mysql_select (thd=0x7a9fb8000d58, tables=0x0, fields=@0x7a9fb801ab00: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7a9fb801adb0, last = 0x7a9fb801adb0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2201187781376, result=0x7a9fb801b948, unit=0x7a9fb8005158, select_lex=0x7a9fb801a848)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_select.cc:5402
      #23 0x00005b5efa90814d in handle_select (thd=0x7a9fb8000d58, lex=0x7a9fb8005078, result=0x7a9fb801b948, setup_tables_done_option=0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_select.cc:634
      #24 0x00005b5efa9e53fa in Sql_cmd_create_table_like::execute (this=0x7a9fb8019f78, thd=0x7a9fb8000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc:13980
      #25 0x00005b5efa8b22ae in mysql_execute_command (thd=0x7a9fb8000d58, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:5862
      #26 0x00005b5efa8a3538 in mysql_parse (thd=0x7a9fb8000d58, rawbuf=0x7a9fb8019e80 "CREATE GLOBAL TEMPORARY TABLE t (x INT) ON COMMIT PRESERVE ROWS SELECT 1 QUERY", length=78, parser_state=0x7aa0e41b2a10)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7895
      #27 0x00005b5efa8a0d19 in dispatch_command (command=COM_QUERY, thd=0x7a9fb8000d58, packet=0x7a9fb800b1f9 "CREATE GLOBAL TEMPORARY TABLE t (x INT) ON COMMIT PRESERVE ROWS SELECT 1 QUERY", packet_length=78, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1882
      #28 0x00005b5efa8a3fba in do_command (thd=0x7a9fb8000d58, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1421
      #29 0x00005b5efaa969ee in do_handle_one_connection (connect=0x5b5efc92a508, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1414
      #30 0x00005b5efaa967d1 in handle_one_connection (arg=0x5b5efc93b5a8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1326
      #31 0x00007aa0e749ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #32 0x00007aa0e7529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      No UB/ASAN issues observed.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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