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

SQL: TRUNCATE FOR SYSTEM_TIME BEFORE [closes #111]

This commit is contained in:
kevg
2017-01-12 13:51:12 +03:00
committed by Aleksey Midenkov
parent 3a64d55aed
commit e069de7d9d
7 changed files with 112 additions and 6 deletions

View File

@@ -90,5 +90,30 @@ update t set a=9;
truncate t for system_time timestamp between '1-1-1' and @ts2;
select * from t for system_time all;
create or replace table t (a int) with system versioning;
insert into t values (1), (2);
update t set a=11 where a=1;
set @ts1=now(6);
update t set a=22 where a=2;
select * from t for system_time all;
truncate t for system_time before timestamp @ts1;
select * from t for system_time all;
truncate t for system_time before timestamp now(6);
select * from t for system_time all;
create or replace table t (a int) with system versioning engine=innodb;
insert into t values (1), (2);
update t set a=11 where a=1;
set @ts1=now(6);
update t set a=22 where a=2;
select * from t for system_time all;
truncate t for system_time before timestamp @ts1;
select * from t for system_time all;
truncate t for system_time before timestamp now(6);
select * from t for system_time all;
--error ER_VERS_WRONG_QUERY_TYPE
select * from t for system_time before timestamp now();
drop table t;
drop procedure truncate_history_of_t;