1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

SQL,IB: REPLACE semantics [#365 bug 8]

This commit is contained in:
Aleksey Midenkov
2017-12-04 12:36:07 +03:00
parent f489865558
commit 56adced376
14 changed files with 135 additions and 34 deletions

View File

@@ -66,14 +66,15 @@ set @str= concat('
with system versioning
engine ', engine);
prepare stmt from @str; execute stmt; drop prepare stmt;
insert into t1 (x, y) values (1, 1), (2, 1), (3, 1);
insert into t1 (x, y) values (1, 1), (2, 1), (3, 1), (4, 1), (5, 1);
start transaction;
update t1 set y= y + 1 where x = 3;
update t1 set y= y + 1 where x = 2;
update t1 set y= y + 1 where x = 3;
update t1 set y= y + 1 where x > 3;
update t1 set y= y + 1 where x > 4;
commit;
select x, y from t1 for system_time
between timestamp '0000-0-0 0:0:0'
and timestamp '2038-01-19 04:14:07';
select x, y, sys_trx_end = 18446744073709551615 as current from t1 for system_time all;
drop table t1;
end~~
create procedure test_04(
@@ -285,19 +286,19 @@ call verify_vtq;
No A B C D
1 1 1 1 1
2 1 1 1 1
call test_03('timestamp(6)', 'myisam', 'sys_end');
x y
1 1
2 1
3 3
3 1
3 2
# Multiple UPDATE of same rows in single transaction create historical
# rows only once (applicable to InnoDB only).
call test_03('bigint unsigned', 'innodb', 'vtq_commit_ts(sys_end)');
x y
1 1
2 1
3 3
3 1
x y current
1 1 1
2 2 1
3 3 1
4 2 1
5 3 1
3 1 0
2 1 0
4 1 0
5 1 0
call verify_vtq;
No A B C D
1 1 1 1 1