ClickHouse/tests/queries/0_stateless/03001_data_version_column.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
649 B
MySQL
Raw Normal View History

2024-03-01 19:51:14 +00:00
DROP TABLE IF EXISTS t_data_version;
CREATE TABLE t_data_version (a UInt64, b UInt64) ENGINE = MergeTree ORDER BY a;
INSERT INTO t_data_version VALUES (1, 1);
INSERT INTO t_data_version VALUES (2, 2);
2024-03-07 14:53:28 +00:00
SELECT _part, _part_data_version, * FROM t_data_version ORDER BY a;
2024-03-01 19:51:14 +00:00
ALTER TABLE t_data_version UPDATE b = a * 100 WHERE 1 SETTINGS mutations_sync = 2;
2024-03-07 14:53:28 +00:00
SELECT _part, _part_data_version, * FROM t_data_version ORDER BY a;
2024-03-01 19:51:14 +00:00
INSERT INTO t_data_version VALUES (3, 3);
2024-03-07 14:53:28 +00:00
-- Check parts pruning.
SELECT _part, _part_data_version, * FROM t_data_version WHERE _part_data_version = 4 ORDER BY a SETTINGS max_rows_to_read = 1;
2024-03-01 19:51:14 +00:00
DROP TABLE t_data_version;