mariadb/mysql-test/suite/versioning/r/truncate.result
2017-09-08 10:22:24 +03:00

37 lines
872 B
Text

create table t (a int);
truncate t to system_time now();
ERROR HY000: System Versioning required: t
create or replace table t (a int) with system versioning;
insert into t values (1);
update t set a=2;
set @test = 'correct';
create trigger trg_before before delete on t for each row set @test = 'incorrect';
create trigger trg_after after delete on t for each row set @test = 'incorrect';
truncate t to system_time now(6);
select @test from t;
@test
correct
drop table t;
create 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;
a
11
22
1
2
truncate t to system_time timestamp @ts1;
select * from t for system_time all;
a
11
22
2
truncate table t to system_time timestamp now(6);
select * from t for system_time all;
a
11
22
drop table t;