1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00
Files
mariadb/mysql-test/suite/versioning/r/truncate.result
2017-12-14 19:11:02 +03:00

47 lines
1.2 KiB
Plaintext

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
### Issue #399, truncate partitioned table is now unimplemented
create or replace table t (a int)
with system versioning
engine myisam
partition by system_time (
partition p0 versioning,
partition pn as of current_timestamp);
truncate table t to system_time current_timestamp;
ERROR 42000: The used command is not allowed with this MariaDB version
drop table t;