1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SQL: FOR SYSTEM_TIME support in VIEW expression [fixes #99]

This commit is contained in:
Aleksey Midenkov
2016-12-20 18:52:45 +00:00
parent 2157c6bfbc
commit 412dd1e1f3
4 changed files with 56 additions and 43 deletions

View File

@ -0,0 +1,25 @@
create table t1 (x int) with system versioning engine innodb;
insert into t1 values (1);
select now(6) into @t1;
update t1 set x= 2;
select now(6) into @t2;
delete from t1;
set @vt1= concat("create view vt1 as select * from t1 for system_time as of timestamp '", @t1, "'");
prepare stmt from @vt1;
execute stmt;
drop prepare stmt;
set @vt2= concat("create view vt2 as select * from t1 for system_time as of timestamp '", @t2, "'");
prepare stmt from @vt2;
execute stmt;
drop prepare stmt;
select * from vt1;
x
1
select * from vt2;
x
2
select * from t1;
x
drop view vt1;
drop view vt2;
drop table t1;