ClickHouse/tests/queries/0_stateless/00976_system_stop_ttl_merges.sql

19 lines
643 B
MySQL
Raw Normal View History

2019-08-01 15:36:12 +00:00
drop table if exists ttl;
create table ttl (d Date, a Int) engine = MergeTree order by a partition by toDayOfMonth(d) ttl d + interval 1 day;
2021-03-31 13:26:57 +00:00
system stop ttl merges ttl;
2019-08-01 15:36:12 +00:00
insert into ttl values (toDateTime('2000-10-10 00:00:00'), 1), (toDateTime('2000-10-10 00:00:00'), 2)
insert into ttl values (toDateTime('2100-10-10 00:00:00'), 3), (toDateTime('2100-10-10 00:00:00'), 4);
select sleep(1) format Null; -- wait if very fast merge happen
optimize table ttl partition 10 final;
select * from ttl order by d, a;
2021-03-31 13:26:57 +00:00
system start ttl merges ttl;
2019-08-01 15:36:12 +00:00
optimize table ttl partition 10 final;
select * from ttl order by d, a;
drop table if exists ttl;