mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
more tests for #14646
This commit is contained in:
parent
8e2231036b
commit
71568130d8
@ -1 +1,18 @@
|
|||||||
1 150
|
1 150
|
||||||
|
2020-02-28 car
|
||||||
|
2020-03-28 dog
|
||||||
|
2020-03-28 dog
|
||||||
|
2020-08-02 car
|
||||||
|
\N cat
|
||||||
|
2020-08-03 car
|
||||||
|
2020-03-28 dog
|
||||||
|
2020-08-02 car
|
||||||
|
2020-03-28 dog
|
||||||
|
2020-08-04 cat
|
||||||
|
2020-08-04 car
|
||||||
|
2020-08-04 car
|
||||||
|
\N cat
|
||||||
|
2020-08-05 \N
|
||||||
|
\N car
|
||||||
|
\N dog
|
||||||
|
\N car
|
||||||
|
@ -14,3 +14,42 @@ ALTER TABLE mutation_table UPDATE price = 150 WHERE id = 1 SETTINGS mutations_sy
|
|||||||
SELECT * FROM mutation_table;
|
SELECT * FROM mutation_table;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS mutation_table;
|
DROP TABLE IF EXISTS mutation_table;
|
||||||
|
|
||||||
|
|
||||||
|
create table mutation_table ( dt Nullable(Date), name Nullable(String))
|
||||||
|
engine MergeTree order by tuple();
|
||||||
|
|
||||||
|
insert into mutation_table (name, dt) values ('car', '2020-02-28');
|
||||||
|
insert into mutation_table (name, dt) values ('dog', '2020-03-28');
|
||||||
|
|
||||||
|
select * from mutation_table;
|
||||||
|
|
||||||
|
alter table mutation_table update dt = toDateOrNull('2020-08-02')
|
||||||
|
where name = 'car' SETTINGS mutations_sync = 2;
|
||||||
|
|
||||||
|
select * from mutation_table;
|
||||||
|
|
||||||
|
insert into mutation_table (name, dt) values ('car', Null);
|
||||||
|
insert into mutation_table (name, dt) values ('cat', Null);
|
||||||
|
|
||||||
|
alter table mutation_table update dt = toDateOrNull('2020-08-03')
|
||||||
|
where name = 'car' and dt is null SETTINGS mutations_sync = 2;
|
||||||
|
|
||||||
|
select * from mutation_table;
|
||||||
|
|
||||||
|
alter table mutation_table update dt = toDateOrNull('2020-08-04')
|
||||||
|
where name = 'car' or dt is null SETTINGS mutations_sync = 2;
|
||||||
|
|
||||||
|
select * from mutation_table;
|
||||||
|
|
||||||
|
insert into mutation_table (name, dt) values (Null, '2020-08-05');
|
||||||
|
|
||||||
|
alter table mutation_table update dt = Null
|
||||||
|
where name is not null SETTINGS mutations_sync = 2;
|
||||||
|
|
||||||
|
select * from mutation_table;
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS mutation_table;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user