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

Server crashes in do_mark_index_columns instead of ER_DUP_ENTRY on partitioned table

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      --source include/have_partition.inc
      --source include/have_innodb.inc
       
      CREATE TABLE t (f INT, UNIQUE(f)) ENGINE=InnoDB PARTITION BY KEY (f) PARTITIONS 2;
      INSERT INTO t (f) VALUES (1), (3);
      --error ER_DUP_ENTRY
      UPDATE t SET f = 0;
       
      DROP TABLE t;
      
      

      10.5 5c92b27d5433df7558f41ac5718481f87bdfa544 debug

      mariadbd: /data/bld/10.5-asan-ubsan/include/my_bitmap.h:97: void bitmap_set_bit(MY_BITMAP*, uint): Assertion `bit < map->n_bits' failed.
      250514 18:14:27 [ERROR] /share8t/bld/10.5-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007fc519053eb2 in __GI___assert_fail (assertion=0x560a826a6b40 "bit < map->n_bits", file=0x560a826a6b80 "/data/bld/10.5-asan-ubsan/include/my_bitmap.h", line=97, function=0x560a826a6be0 "void bitmap_set_bit(MY_BITMAP*, uint)") at ./assert/assert.c:101
      #11 0x0000560a7f3d14e1 in bitmap_set_bit (map=map@entry=0x7fc5027c2d10, bit=bit@entry=48829) at /data/bld/10.5-asan-ubsan/include/my_bitmap.h:97
      #12 0x0000560a7f3d89a7 in do_mark_index_columns (table=table@entry=0x6190000fbe98, index=index@entry=1, bitmap=bitmap@entry=0x7fc5027c2d10, read=read@entry=false) at /data/bld/10.5-asan-ubsan/sql/table.cc:7330
      #13 0x0000560a7f400886 in TABLE::mark_index_columns_no_reset (bitmap=0x7fc5027c2d10, index=1, this=0x6190000fbe98) at /data/bld/10.5-asan-ubsan/sql/table.cc:7342
      #14 TABLE::mark_index_columns (this=this@entry=0x6190000fbe98, index=index@entry=1, bitmap=bitmap@entry=0x7fc5027c2d10) at /data/bld/10.5-asan-ubsan/sql/table.cc:7297
      #15 0x0000560a7f371a78 in prepare_record_for_error_message (error=<optimized out>, table=table@entry=0x6190000fbe98) at /data/bld/10.5-asan-ubsan/sql/sql_update.cc:280
      #16 0x0000560a7f3a7df8 in mysql_update (thd=thd@entry=0x62b00007e218, table_list=<optimized out>, fields=..., values=..., conds=conds@entry=0x0, order_num=order_num@entry=0, order=<optimized out>, limit=18446744073709551614, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /data/bld/10.5-asan-ubsan/sql/sql_update.cc:1156
      #17 0x0000560a7ee372a0 in mysql_execute_command (thd=thd@entry=0x62b00007e218) at /data/bld/10.5-asan-ubsan/sql/sql_parse.cc:4507
      #18 0x0000560a7ee54fe5 in mysql_parse (thd=thd@entry=0x62b00007e218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fc5027c4c60, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/bld/10.5-asan-ubsan/sql/sql_parse.cc:8243
      #19 0x0000560a7ee5e423 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62b00007e218, packet=packet@entry=0x62900026c219 "UPDATE t SET f = 0", packet_length=packet_length@entry=18, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/bld/10.5-asan-ubsan/sql/sql_parse.cc:1891
      #20 0x0000560a7ee6acf4 in do_command (thd=thd@entry=0x62b00007e218) at /data/bld/10.5-asan-ubsan/sql/sql_parse.cc:1375
      #21 0x0000560a7f5a087e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x608000003d38, put_in_cache=put_in_cache@entry=true) at /data/bld/10.5-asan-ubsan/sql/sql_connect.cc:1386
      #22 0x0000560a7f5a19db in handle_one_connection (arg=0x608000003d38) at /data/bld/10.5-asan-ubsan/sql/sql_connect.cc:1298
      #23 0x0000560a80f2f5ee in pfs_spawn_thread (arg=0x61500000e418) at /data/bld/10.5-asan-ubsan/storage/perfschema/pfs.cc:2201
      #24 0x00007fc5190a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #25 0x00007fc51912885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      10.5 5c92b27d5433df7558f41ac5718481f87bdfa544 non-debug

      #2  <signal handler called>
      #3  do_mark_index_columns (read=false, bitmap=0x7f3e67d67160, index=1, table=0x7f3dfc0f1998) at /data/bld/10.5-rel/sql/table.cc:7330
      #4  TABLE::mark_index_columns_no_reset (bitmap=0x7f3e67d67160, index=1, this=0x7f3dfc0f1998) at /data/bld/10.5-rel/sql/table.cc:7342
      #5  TABLE::mark_index_columns (this=0x7f3dfc0f1998, index=1, bitmap=0x7f3e67d67160) at /data/bld/10.5-rel/sql/table.cc:7297
      #6  0x000055acb623fdf9 in prepare_record_for_error_message (error=<optimized out>, table=table@entry=0x7f3dfc0f1998) at /data/bld/10.5-rel/sql/sql_update.cc:280
      #7  0x000055acb6244b17 in mysql_update (thd=thd@entry=0x7f3dfc000c68, table_list=<optimized out>, fields=..., values=..., conds=<optimized out>, order_num=<optimized out>, order=<optimized out>, limit=18446744073709551614, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /data/bld/10.5-rel/sql/sql_update.cc:1156
      #8  0x000055acb6178bd9 in mysql_execute_command (thd=thd@entry=0x7f3dfc000c68) at /data/bld/10.5-rel/sql/sql_parse.cc:4507
      #9  0x000055acb617b58c in mysql_parse (thd=0x7f3dfc000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/bld/10.5-rel/sql/sql_parse.cc:8243
      #10 0x000055acb617dd45 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f3dfc000c68, packet=packet@entry=0x7f3dfc008109 "UPDATE t SET f = 0", packet_length=packet_length@entry=18, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/bld/10.5-rel/sql/sql_parse.cc:1992
      #11 0x000055acb617fa5d in do_command (thd=thd@entry=0x7f3dfc000c68) at /data/bld/10.5-rel/sql/sql_parse.cc:1375
      #12 0x000055acb628b16d in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /data/bld/10.5-rel/sql/sql_connect.cc:1386
      #13 0x000055acb628b5d5 in handle_one_connection (arg=arg@entry=0x55ace2e29898) at /data/bld/10.5-rel/sql/sql_connect.cc:1298
      #14 0x000055acb6645114 in pfs_spawn_thread (arg=0x55ace2dbe2c8) at /data/bld/10.5-rel/storage/perfschema/pfs.cc:2201
      #15 0x00007f3e7b2a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #16 0x00007f3e7b32885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The failure started happening after this commit in 10.5.29:

      commit c1492f3d077e47a015c6e4c5dcd2107b803ac3f4
      Author: Aleksey Midenkov
      Date:   Sun Mar 30 18:54:23 2025 +0300
       
          MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON
                     in row_update_for_mysql
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.