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

Assertion `table->vers_write' fails upon ODKU into table with versioned column

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT, b INT, c INT WITH SYSTEM VERSIONING, UNIQUE(b));
      INSERT INTO t (b) VALUES (1);
      INSERT INTO t (b) VALUES (1),(1) ON DUPLICATE KEY UPDATE a = 3;
       
      DROP TABLE t;
      

      10.11 09657805d04dfe6dfe33fb4b3003e06b29c835bd

      mariadbd: /data/bld/10.11-asan-ubsan/sql/sql_base.cc:8986: bool vers_update_or_validate_fields(TABLE*): Assertion `table->vers_write' failed.
      260218 10:21:22 [ERROR] /share8t/bld/10.11-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007f6536853eb2 in __GI___assert_fail (assertion=0x5654e3d234c0 "table->vers_write", file=0x5654e3d21720 "/data/bld/10.11-asan-ubsan/sql/sql_base.cc", line=8986, function=0x5654e3d23500 "bool vers_update_or_validate_fields(TABLE*)") at ./assert/assert.c:101
      #11 0x00005654e00580a4 in vers_update_or_validate_fields (table=table@entry=0x61900005a598) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:8986
      #12 0x00005654e00ba82b in fill_record (thd=thd@entry=0x62c0000b0218, table_arg=table_arg@entry=0x61900005a598, fields=..., values=..., ignore_errors=ignore_errors@entry=false, update=update@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:9138
      #13 0x00005654e00baedf in fill_record_n_invoke_before_triggers (thd=thd@entry=0x62c0000b0218, table=table@entry=0x61900005a598, fields=..., values=..., ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /data/bld/10.11-asan-ubsan/sql/sql_base.cc:9279
      #14 0x00005654e0281b5d in mysql_insert (thd=thd@entry=0x62c0000b0218, table_list=<optimized out>, fields=..., values_list=..., update_fields=..., update_values=..., duplic=<optimized out>, ignore=<optimized out>, result=<optimized out>) at /data/bld/10.11-asan-ubsan/sql/sql_insert.cc:1130
      #15 0x00005654e041628b in mysql_execute_command (thd=thd@entry=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:4662
      #16 0x00005654e043106a in mysql_parse (thd=thd@entry=0x62c0000b0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f652c715ab0) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:8223
      #17 0x00005654e043a417 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=packet@entry=0x62900024e219 "INSERT INTO t (b) VALUES (1),(1) ON DUPLICATE KEY UPDATE a = 3", packet_length=packet_length@entry=62, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1924
      #18 0x00005654e044711c in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_parse.cc:1434
      #19 0x00005654e0c4385e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000039b8, put_in_cache=put_in_cache@entry=true) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1475
      #20 0x00005654e0c449bb in handle_one_connection (arg=0x6080000039b8) at /data/bld/10.11-asan-ubsan/sql/sql_connect.cc:1387
      #21 0x00005654e25c9459 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/10.11-asan-ubsan/storage/perfschema/pfs.cc:2201
      #22 0x00007f65368a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #23 0x00007f653692885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Reproducible on 10.11+, not reproducible on 10.6.
      The failure apparently started happening after this merge in 10.11.5; it's a fairly big merge with several versioning-related changes, I didn't try to find the individual commit which could have caused it.

      commit 036df5f97067d3c70082328a4a58afd4143b4af2
      Merge: 1ba5a0205c3 d2fdba94cff
      Author: Oleksandr Byelkin
      Date:   Tue Aug 8 14:57:31 2023 +0200
       
          Merge branch '10.10' into 10.11
      

      No obvious immediate problem on a non-debug build.

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            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.