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

Index corruption on UPDATE when using versioned InnoDB table

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
      SET sql_mode='';
      CREATE TABLE t(c1 DATE KEY,c2 TEXT AS(c1)VIRTUAL, INDEX (c2)) WITH SYSTEM VERSIONING ENGINE=InnoDB;
      INSERT INTO t VALUES('','');
      UPDATE t SET c1=DATE('1:1:1');
      

      Leads to:

      CS 13.0.1 3a2f8e27981b76b99d2b87cc3bcec5ef022b2b23 (Optimized, Clang 21.1.3-20250923) Build 10/04/2026

      2026-04-11  9:23:40 0 [Note] /test/MD100426-mariadb-13.0.1-linux-x86_64-opt/bin/mariadbd: ready for connections.
      Version: '13.0.1-MariaDB'  socket: '/test/MD100426-mariadb-13.0.1-linux-x86_64-opt/socket.sock'  port: 11111  MariaDB Server
      2026-04-11  9:23:42 4 [ERROR] InnoDB: Record in index `c2` of table `test`.`t` was not found on update: TUPLE (info_bits=0, 3 fields): {[10]0001-01-01(0x303030312D30312D3031),[3]   (0x800000),[7]     B?(0xFFFFFFFF0F423F)} at: COMPACT RECORD(info_bits=0, 3 fields): {[10]0000-00-00(0x303030302D30302D3030),[3]   (0x800000),[7]     B?(0xFFFFFFFF0F423F)}
      

      CS 13.0.1 3a2f8e27981b76b99d2b87cc3bcec5ef022b2b23 (Debug, Clang 21.1.3-20250923) Build 10/04/2026

      mariadbd: /test/13.0_dbg/storage/innobase/row/row0upd.cc:1903: dberr_t row_upd_sec_index_entry(upd_node_t *, que_thr_t *): Assertion `0' failed.
      

      CS 13.0.1 3a2f8e27981b76b99d2b87cc3bcec5ef022b2b23 (Debug, Clang 21.1.3-20250923) Build 10/04/2026

      Core was generated by `/test/MD100426-mariadb-13.0.1-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      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 3650222)]
      (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  0x000078cfd7a4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000078cfd7a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000078cfd7a2881b in __assert_fail_base (fmt=0x78cfd7bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5e025e947d67 "0", file=file@entry=0x5e025ea09cd9 "/test/13.0_dbg/storage/innobase/row/row0upd.cc", line=line@entry=1903, function=function@entry=0x5e025e837386 "dberr_t row_upd_sec_index_entry(upd_node_t *, que_thr_t *)") at ./assert/assert.c:94
      #6  0x000078cfd7a3b507 in __assert_fail (assertion=0x5e025e947d67 "0", file=0x5e025ea09cd9 "/test/13.0_dbg/storage/innobase/row/row0upd.cc", line=1903, function=0x5e025e837386 "dberr_t row_upd_sec_index_entry(upd_node_t *, que_thr_t *)") at ./assert/assert.c:103
      #7  0x00005e025fe94dd0 in row_upd_sec_index_entry (node=0x70ceb402c4c8, thr=0x70ceb408bd38) at /test/13.0_dbg/storage/innobase/row/row0upd.cc:1903
      #8  0x00005e025fe8fdc7 in row_upd_sec_step (node=0x70ceb402c4c8, thr=0x70ceb408bd38) at /test/13.0_dbg/storage/innobase/row/row0upd.cc:2030
      #9  0x00005e025fe8dfad in row_upd (node=0x70ceb402c4c8, thr=0x70ceb408bd38)at /test/13.0_dbg/storage/innobase/row/row0upd.cc:2777
      #10 0x00005e025fe8dc30 in row_upd_step (thr=0x70ceb408bd38)at /test/13.0_dbg/storage/innobase/row/row0upd.cc:2892
      #11 0x00005e025fe317f2 in row_update_for_mysql (prebuilt=0x70ceb402bad8)at /test/13.0_dbg/storage/innobase/row/row0mysql.cc:1678
      #12 0x00005e025fab3968 in ha_innobase::update_row (this=0x70ceb4032878, old_row=0x70ceb4033100 "\376", new_row=0x70ceb40330e0 "\376!\002")at /test/13.0_dbg/storage/innobase/handler/ha_innodb.cc:8567
      #13 0x00005e025f12e6e4 in handler::ha_update_row (this=0x70ceb4032878, old_data=0x70ceb4033100 "\376", new_data=0x70ceb40330e0 "\376!\002")at /test/13.0_dbg/sql/handler.cc:8581
      #14 0x00005e025f712943 in Sql_cmd_update::update_single_table (this=0x70ceb401abf8, thd=0x70ceb4000d58)at /test/13.0_dbg/sql/sql_update.cc:1064
      #15 0x00005e025f719bd7 in Sql_cmd_update::execute_inner (this=0x70ceb401abf8, thd=0x70ceb4000d58) at /test/13.0_dbg/sql/sql_update.cc:3237
      #16 0x00005e025f658e29 in Sql_cmd_dml::execute (this=0x70ceb401abf8, thd=0x70ceb4000d58) at /test/13.0_dbg/sql/sql_select.cc:34993
      #17 0x00005e025f5a563b in mysql_execute_command (thd=0x70ceb4000d58, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:4444
      #18 0x00005e025f59c9c8 in mysql_parse (thd=0x70ceb4000d58, rawbuf=0x70ceb401a110 "UPDATE t SET c1=DATE('1:1:1')", length=29, parser_state=0x78cfcc1679f0) at /test/13.0_dbg/sql/sql_parse.cc:7941
      #19 0x00005e025f59a11e in dispatch_command (command=COM_QUERY, thd=0x70ceb4000d58, packet=0x70ceb400b4b9 "UPDATE t SET c1=DATE('1:1:1')", packet_length=29, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1898
      #20 0x00005e025f59d44a in do_command (thd=0x70ceb4000d58, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1432
      #21 0x00005e025f7a070e in do_handle_one_connection (connect=0x5e02622dc828, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1503
      #22 0x00005e025f7a04f1 in handle_one_connection (arg=0x5e02622e9ae8)at /test/13.0_dbg/sql/sql_connect.cc:1415
      #23 0x000078cfd7a9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #24 0x000078cfd7b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  100426  f39b634db715cd9dc1835653d1ce544df2aa1613  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  10.6   opt  100426  f39b634db715cd9dc1835653d1ce544df2aa1613  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  10.11  dbg  100426  ba774a0a90fac0163babe9d7a964aa36503e1711  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  10.11  opt  100426  ba774a0a90fac0163babe9d7a964aa36503e1711  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  11.4   dbg  100426  dc89915ad9bf3dcb67e66d2844c77ec0403373de  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  11.4   opt  100426  dc89915ad9bf3dcb67e66d2844c77ec0403373de  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  11.8   dbg  100426  e47db94aea7f0d6e0177e948486fc8860331f05f  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  11.8   opt  100426  e47db94aea7f0d6e0177e948486fc8860331f05f  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  12.2   dbg  100426  d26a6f44c1f2119377e79a9540886c6d8c01472f  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  12.2   opt  100426  d26a6f44c1f2119377e79a9540886c6d8c01472f  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  12.3   dbg  100426  f5bb9922107672e88f7b5cbdb3d25151cc5744bb  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  12.3   opt  100426  f5bb9922107672e88f7b5cbdb3d25151cc5744bb  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      CS  13.0   dbg  100426  3a2f8e27981b76b99d2b87cc3bcec5ef022b2b23  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      CS  13.0   opt  100426  3a2f8e27981b76b99d2b87cc3bcec5ef022b2b23  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      ES  10.6   dbg  100426  84a80c8b38208d362225496da08d86d8d454e453  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      ES  10.6   opt  100426  84a80c8b38208d362225496da08d86d8d454e453  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      ES  11.4   dbg  100426  8b2bf17b733262409422ce7d039a0c021fc47077  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      ES  11.4   opt  100426  8b2bf17b733262409422ce7d039a0c021fc47077  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD
      ES  11.8   dbg  100426  854cae81f52e477c7777a51db26ba640d8755b81  0|SIGABRT|row_upd_sec_index_entry|row_upd_sec_step|row_upd|row_upd_step
      ES  11.8   opt  100426  854cae81f52e477c7777a51db26ba640d8755b81  INNODB_ERROR|Record in index.*of table.*was not found on update: TUPLE.*at: COMPACT RECORD                  
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.