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

GTT: Failing assertion: prebuilt->template_type == ROW_MYSQL_WHOLE_ROW on UPDATE

    XMLWordPrintable

Details

    • Q1/2026 Server Development

    Description

      While we have MDEV-21428 which looks somewhat related, this is a new issue on UPDATE of a GTT, and not directly reproducible with TT.

      --source include/have_innodb.inc
      CREATE GLOBAL TEMPORARY TABLE t (c INT) ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
      SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
      FLUSH TABLES t WITH READ LOCK;
      INSERT t VALUES (1);
      UPDATE t SET c=c+1;
      

      Leads to:

      MDEV-35915-v11 CS 12.2.0 8934bac9ea05b79f7a5109d9e980cb939a24d4e3 (Optimized, Clang 21.1.3-20250923) Build 19/01/2026

      InnoDB: Failing assertion: prebuilt->template_type == ROW_MYSQL_WHOLE_ROW
      

      MDEV-35915-v11 CS 12.2.0 8934bac9ea05b79f7a5109d9e980cb939a24d4e3 (Optimized, Clang 21.1.3-20250923) Build 19/01/2026

      Core was generated by `/test/MDEV-35915_v11b_MD190126-mariadb-12.2.0-linux-x86_64-opt/bin/mariadbd --n'.
      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 1247709)]
      (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  0x00007d4b16e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007d4b16e288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000060096e5419af in ut_dbg_assertion_failed (expr=0x60096d58521c "prebuilt->template_type == ROW_MYSQL_WHOLE_ROW", file=0x60096d57e064 "/test/bb-12.2-nikita-global-tmp_opt/storage/innobase/row/row0mysql.cc", line=line@entry=1605)at /test/bb-12.2-nikita-global-tmp_opt/storage/innobase/ut/ut0dbg.cc:60
      #6  0x000060096e4ebe5f in row_update_for_mysql (prebuilt=0x7d49e802c348)at /test/bb-12.2-nikita-global-tmp_opt/storage/innobase/row/row0mysql.cc:1605
      #7  0x000060096e36ca68 in ha_innobase::update_row (this=0x7d49e802dbc8, old_row=0x7d49e802e430 "\375\001", new_row=0x7d49e802e428 "\375\002")at /test/bb-12.2-nikita-global-tmp_opt/storage/innobase/handler/ha_innodb.cc:8566
      #8  0x000060096dd029fb in handler::ha_update_row (this=0x7d49e802dbc8, old_data=0x7d49e802e430 "\375\001", new_data=0x7d49e802e428 "\375\002")at /test/bb-12.2-nikita-global-tmp_opt/sql/handler.cc:8311
      #9  0x000060096e0b778f in Sql_cmd_update::update_single_table (this=this@entry=0x7d49e8018280, thd=thd@entry=0x7d49e8000c68)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_update.cc:1063
      #10 0x000060096e0bc33e in Sql_cmd_update::execute_inner (this=0x7d49e8018280, thd=0x7d49e8000c68)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_update.cc:3223
      #11 0x000060096e039c97 in Sql_cmd_dml::execute (this=0x7d49e8018280, thd=0x7d49e8000c68)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_select.cc:34719
      #12 0x000060096dfbf455 in mysql_execute_command (thd=thd@entry=0x7d49e8000c68, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_parse.cc:4421
      #13 0x000060096dfba5c4 in mysql_parse (thd=thd@entry=0x7d49e8000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7d4b14101420)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_parse.cc:7912
      #14 0x000060096dfb8d5d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7d49e8000c68, packet=packet@entry=0x7d49e80089f9 "UPDATE t SET c=c+1", packet_length=packet_length@entry=18, blocking=true)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_parse.cc:1898
      #15 0x000060096dfbaa41 in do_command (thd=thd@entry=0x7d49e8000c68, blocking=true) at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_parse.cc:1437
      #16 0x000060096e110b3d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6009705889c8, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_connect.cc:1414
      #17 0x000060096e1108ff in handle_one_connection (arg=arg@entry=0x6009705889c8)at /test/bb-12.2-nikita-global-tmp_opt/sql/sql_connect.cc:1326
      #18 0x000060096e2d58b9 in pfs_spawn_thread (arg=0x60097052b818)at /test/bb-12.2-nikita-global-tmp_opt/storage/perfschema/pfs.cc:2198
      #19 0x00007d4b16e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #20 0x00007d4b16f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      MDEV-35915-v11 CS 12.2.0 8934bac9ea05b79f7a5109d9e980cb939a24d4e3 (Debug, Clang 21.1.3-20250923) Build 19/01/2026

      InnoDB: Failing assertion: prebuilt->template_type == ROW_MYSQL_WHOLE_ROW
      

      MDEV-35915-v11 CS 12.2.0 8934bac9ea05b79f7a5109d9e980cb939a24d4e3 (Debug, Clang 21.1.3-20250923) Build 19/01/2026

      Core was generated by `/test/MDEV-35915_v11b_MD190126-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --n'.
      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 1267313)]
      (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  0x0000705d23c4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000705d23c288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00005cde46ef4f2d in ut_dbg_assertion_failed (expr=0x5cde45980384 "prebuilt->template_type == ROW_MYSQL_WHOLE_ROW", file=0x5cde45a8ba9f "/test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0mysql.cc", line=1605)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/ut/ut0dbg.cc:60
      #6  0x00005cde46e28788 in row_update_for_mysql (prebuilt=0x705bf4036de8)at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/row/row0mysql.cc:1605
      #7  0x00005cde46acf2e2 in ha_innobase::update_row (this=0x705bf4038a58, old_row=0x705bf40392c0 "\375\001", new_row=0x705bf40392b8 "\375\002")at /test/bb-12.2-nikita-global-tmp_dbg/storage/innobase/handler/ha_innodb.cc:8566
      #8  0x00005cde461a67e4 in handler::ha_update_row (this=0x705bf4038a58, old_data=0x705bf40392c0 "\375\001", new_data=0x705bf40392b8 "\375\002")at /test/bb-12.2-nikita-global-tmp_dbg/sql/handler.cc:8311
      #9  0x00005cde46745e08 in Sql_cmd_update::update_single_table (this=0x705bf401aa80, thd=0x705bf4000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_update.cc:1063
      #10 0x00005cde4674cff7 in Sql_cmd_update::execute_inner (this=0x705bf401aa80, thd=0x705bf4000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_update.cc:3223
      #11 0x00005cde4668df69 in Sql_cmd_dml::execute (this=0x705bf401aa80, thd=0x705bf4000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_select.cc:34719
      #12 0x00005cde465e094a in mysql_execute_command (thd=0x705bf4000d58, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:4421
      #13 0x00005cde465d7e08 in mysql_parse (thd=0x705bf4000d58, rawbuf=0x705bf4019e80 "UPDATE t SET c=c+1", length=18, parser_state=0x705d209b2a10)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7912
      #14 0x00005cde465d55e9 in dispatch_command (command=COM_QUERY, thd=0x705bf4000d58, packet=0x705bf400b1f9 "UPDATE t SET c=c+1", packet_length=18, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1898
      #15 0x00005cde465d888a in do_command (thd=0x705bf4000d58, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1437
      #16 0x00005cde467cb25e in do_handle_one_connection (connect=0x5cde48958b48, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1414
      #17 0x00005cde467cb041 in handle_one_connection (arg=0x5cde4896c608)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1326
      #18 0x0000705d23c9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #19 0x0000705d23d29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      No UBSAN/ASAN issues observed. Btw, note this FLUSH TABLES outcome on trunk:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      12.2.0-dbg>CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.001 sec)
       
      12.2.0-dbg>SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
      Query OK, 0 rows affected (0.000 sec)
       
      12.2.0-dbg>FLUSH TABLES t WITH READ LOCK;
      ERROR 1146 (42S02): Table 'test.t' doesn't exist
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Roel Van de Paar Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.