ClickHouse/tests/queries/0_stateless/00363_defaults.sql
Alexander Tokmakov c068593a0d fix tests
2022-06-23 12:58:34 +02:00

21 lines
602 B
SQL

DROP TABLE IF EXISTS prewhere_defaults;
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE prewhere_defaults (d Date DEFAULT '2000-01-01', k UInt64 DEFAULT 0, x UInt16) ENGINE = MergeTree(d, k, 1);
INSERT INTO prewhere_defaults (x) VALUES (1);
SET max_block_size = 1;
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
ALTER TABLE prewhere_defaults ADD COLUMN y UInt16 DEFAULT x;
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
INSERT INTO prewhere_defaults (x) VALUES (2);
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
DROP TABLE prewhere_defaults;