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

20 lines
556 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS prewhere_defaults;
2016-08-15 19:43:51 +00:00
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;