ClickHouse/tests/queries/0_stateless/00952_insert_into_distributed_with_materialized_column.sql

43 lines
1.3 KiB
MySQL
Raw Normal View History

2019-05-31 18:32:55 +00:00
DROP TABLE IF EXISTS local_00952;
DROP TABLE IF EXISTS distributed_00952;
--
-- insert_distributed_sync=0
--
SELECT 'insert_distributed_sync=0';
SET insert_distributed_sync=0;
2019-05-31 18:32:55 +00:00
CREATE TABLE local_00952 (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192);
CREATE TABLE distributed_00952 AS local_00952 ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), local_00952, rand());
INSERT INTO distributed_00952 VALUES ('2018-08-01');
SYSTEM FLUSH DISTRIBUTED distributed_00952;
SELECT * FROM distributed_00952;
SELECT date, value FROM distributed_00952;
SELECT * FROM local_00952;
SELECT date, value FROM local_00952;
DROP TABLE distributed_00952;
DROP TABLE local_00952;
--
-- insert_distributed_sync=1
--
SELECT 'insert_distributed_sync=1';
SET insert_distributed_sync=1;
CREATE TABLE local_00952 (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192);
CREATE TABLE distributed_00952 AS local_00952 ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), local_00952, rand());
2019-05-31 18:32:55 +00:00
INSERT INTO distributed_00952 VALUES ('2018-08-01');
2019-05-31 18:32:55 +00:00
SELECT * FROM distributed_00952;
SELECT date, value FROM distributed_00952;
2019-05-31 18:32:55 +00:00
SELECT * FROM local_00952;
SELECT date, value FROM local_00952;
2019-06-07 14:59:41 +00:00
DROP TABLE distributed_00952;
DROP TABLE local_00952;