[MDEV-15427] IB: TRX_ID based operations inside transaction generate history Created: 2018-02-27  Updated: 2018-05-29  Resolved: 2018-04-10

Status: Closed
Project: MariaDB Server
Component/s: Versioned Tables
Affects Version/s: 10.3.5
Fix Version/s: 10.3.6

Type: Bug Priority: Major
Reporter: Aleksey Midenkov Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 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.



 Comments   
Comment by Aleksey Midenkov [ 2018-02-27 ]

Analysis

Comment by Ralf Gebhardt [ 2018-02-27 ]

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 |
+------+-----------+---------+

Generated at Thu Feb 08 08:21:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.