ClickHouse/tests/queries/0_stateless/00571_alter_nullable.sql

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

14 lines
591 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS nullable_00571;
CREATE TABLE nullable_00571 (x String) ENGINE = MergeTree ORDER BY x;
INSERT INTO nullable_00571 VALUES ('hello'), ('world');
SELECT * FROM nullable_00571;
ALTER TABLE nullable_00571 ADD COLUMN n Nullable(UInt64);
SELECT * FROM nullable_00571;
ALTER TABLE nullable_00571 DROP COLUMN n;
ALTER TABLE nullable_00571 ADD COLUMN n Nullable(UInt64) DEFAULT NULL;
SELECT * FROM nullable_00571;
ALTER TABLE nullable_00571 DROP COLUMN n;
ALTER TABLE nullable_00571 ADD COLUMN n Nullable(UInt64) DEFAULT 0;
SELECT * FROM nullable_00571;
DROP TABLE nullable_00571;