ClickHouse/tests/queries/0_stateless/00363_defaults.sql

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

21 lines
602 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS prewhere_defaults;
2016-08-15 19:43:51 +00:00
2022-06-23 10:58:34 +00:00
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);
2016-08-15 19:43:51 +00:00
INSERT INTO prewhere_defaults (x) VALUES (1);
2016-08-15 19:43:51 +00:00
SET max_block_size = 1;
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
2016-08-15 19:43:51 +00:00
ALTER TABLE prewhere_defaults ADD COLUMN y UInt16 DEFAULT x;
2016-08-15 19:43:51 +00:00
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
2016-08-15 19:43:51 +00:00
INSERT INTO prewhere_defaults (x) VALUES (2);
2016-08-15 19:43:51 +00:00
SELECT * FROM prewhere_defaults PREWHERE x != 0 ORDER BY x;
2016-08-15 19:43:51 +00:00
DROP TABLE prewhere_defaults;