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

IB: TRX_ID based operations inside transaction generate history

Details

    Description

      Reproduce

      create or replace table t1 (
        x int,
        sys_start bigint unsigned as row start invisible,
        sys_end bigint unsigned as row end invisible,
        period for system_time (row_start, row_end)
      ) engine innodb with system versioning;
      begin;
      insert into t1 values (1);
      delete from t1;
      commit;
      

      Result

      History record is generated with row_start == row_end.

      Expected

      No record is generated.

      Attachments

        Activity

          ralf.gebhardt Ralf Gebhardt added a comment - - edited

          The same happens for update+delete:

          create or replace table t1 (
            x int,
            sys_start bigint unsigned as row start invisible,
            sys_end bigint unsigned as row end invisible,
            period for system_time (sys_start, sys_end)
          ) engine innodb with system versioning;
           
          insert into t1 (x) values (1);
          begin;
          update t1 set x= 3;
          delete from t1 where x=3;
          commit;
           
          select *,sys_start,sys_end from t1 for system_time all;
          

          +------+-----------+---------+
          | x    | sys_start | sys_end |
          +------+-----------+---------+
          |    3 |        88 |      88 |
          |    1 |        85 |      88 |
          +------+-----------+---------+
          

          ralf.gebhardt Ralf Gebhardt added a comment - - edited The same happens for update+delete: create or replace table t1 ( x int , sys_start bigint unsigned as row start invisible, sys_end bigint unsigned as row end invisible, period for system_time (sys_start, sys_end) ) engine innodb with system versioning;   insert into t1 (x) values (1); begin ; update t1 set x= 3; delete from t1 where x=3; commit ;   select *,sys_start,sys_end from t1 for system_time all ; +------+-----------+---------+ | x | sys_start | sys_end | +------+-----------+---------+ | 3 | 88 | 88 | | 1 | 85 | 88 | +------+-----------+---------+

          People

            serg Sergei Golubchik
            midenok Aleksey Midenkov
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.