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

Corruption errors, Assertion `0' upon ALTER IGNORE handling duplicate keys

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Hopefully it will be fixed along with MDEV-38948 and/or MDEV-38949, but I'm not quite sure about it, as both the test case and the failure are different, so filing separately.

      --source include/have_innodb.inc
       
      CREATE TABLE t (f VARCHAR(8), UNIQUE(f)) ENGINE=InnoDB;
      INSERT INTO t VALUES ('foo'),('foobar');
      ALTER IGNORE TABLE t MODIFY f VARCHAR(3);
      DELETE FROM t;
       
      DROP TABLE t;
      

      10.11 e795ea6c5fff3a3a175bed40576ba44f53fddaee

      2026-03-03 14:33:51 4 [ERROR] InnoDB: Record in index `f` of table `test`.`t` was not found on update: TUPLE (info_bits=0, 2 fields): {[3]foo(0x666F6F),[6]      (0x000000000203)}
       at: COMPACT RECORD(info_bits=32, 2 fields): {[3]foo(0x666F6F),[6]      (0x000000000202)}
      mariadbd: /data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc:1926: dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*): Assertion `0' failed.
      260303 14:33:51 [ERROR] /share8t/bld/10.11-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #9  0x00007f771ec45395 in __assert_fail_base (fmt=0x7f771edb9a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x556df9115800 "0", file=file@entry=0x556df911f860 "/data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc", line=line@entry=1926, function=function@entry=0x556df911dda0 "dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*)") at ./assert/assert.c:92
      #10 0x00007f771ec53eb2 in __GI___assert_fail (assertion=0x556df9115800 "0", file=0x556df911f860 "/data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc", line=1926, function=0x556df911dda0 "dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*)") at ./assert/assert.c:101
      #11 0x0000556df7cf85db in row_upd_sec_index_entry (node=node@entry=0x620000012840, thr=thr@entry=0x620000012bf0) at /data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc:1926
      #12 0x0000556df7cf96ff in row_upd_sec_step (node=node@entry=0x620000012840, thr=thr@entry=0x620000012bf0) at /data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc:2054
      #13 0x0000556df7cfbd94 in row_upd (node=node@entry=0x620000012840, thr=thr@entry=0x620000012bf0) at /data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc:2801
      #14 0x0000556df7cfc8f4 in row_upd_step (thr=thr@entry=0x620000012bf0) at /data/bld/10.11-asan-ubsan/storage/innobase/row/row0upd.cc:2916
      #15 0x0000556df7c0f94d in row_update_for_mysql (prebuilt=<optimized out>) at /data/bld/10.11-asan-ubsan/storage/innobase/row/row0mysql.cc:1666
      #16 0x0000556df763a959 in ha_innobase::delete_row (this=0x6250002a5948, record=<optimized out>) at /data/bld/10.11-asan-ubsan/storage/innobase/handler/ha_innodb.cc:8721
      #17 0x0000556df6357782 in handler::ha_delete_row (this=this@entry=0x6250002a5948, buf=buf@entry=0x6250002a6150 "\376\003foo", '\276' <repeats 19 times>, "\300a*") at /data/bld/10.11-asan-ubsan/sql/handler.cc:7971
      #18 0x0000556df4e38809 in TABLE::delete_row<false> (this=this@entry=0x6190000c3598, treat_versioned=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_delete.cc:364
      #19 0x0000556df4e38870 in TABLE::delete_row (this=this@entry=0x6190000c3598) at /data/bld/10.11-asan-ubsan/sql/table.h:1861
      #20 0x0000556df4e30372 in mysql_delete (thd=thd@entry=0x62c0001f0218, table_list=<optimized out>, conds=<optimized out>, order_list=order_list@entry=0x62c0001f5228, limit=18446744073709551614, options=options@entry=0, result=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_delete.cc:945
      #21 0x0000556df5069238 in mysql_execute_command (thd=thd@entry=0x62c0001f0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:4962
      #22 0x0000556df507e36c in mysql_parse (thd=thd@entry=0x62c0001f0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x77770ecc2ab0) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:8223
      #23 0x0000556df5087719 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0001f0218, packet=packet@entry=0x629000276219 "DELETE FROM t", packet_length=packet_length@entry=13, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1924
      #24 0x0000556df509441e in do_command (thd=thd@entry=0x62c0001f0218, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1434
      #25 0x0000556df5890d36 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x608000019438, put_in_cache=put_in_cache@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1475
      #26 0x0000556df5891e93 in handle_one_connection (arg=0x608000019438) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1387
      #27 0x0000556df72172a5 in pfs_spawn_thread (arg=0x617000007e98) at /data/bld/10.11-asan-ubsan/storage/perfschema/pfs.cc:2201
      #28 0x00007f771eca81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #29 0x00007f771ed2885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      A non-debug doesn't crash (naturally), but the corruption error is still there.

      The failure started happening after this commit in 10.11:

      commit e5fed9eaf49419fe81d3695a4323816db1df8e32 (HEAD)
      Author: Thirunarayanan Balathandayuthapani
      Date:   Thu Feb 26 12:07:23 2026 +0530
       
          MDEV-36436  Assertion "unexpected references" == 0 after ALTER IGNORE TABLE
      

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.