2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS nullable_alter;
|
|
|
|
CREATE TABLE nullable_alter (d Date DEFAULT '2000-01-01', x String) ENGINE = MergeTree(d, d, 1);
|
2017-04-23 07:27:31 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO nullable_alter (x) VALUES ('Hello'), ('World');
|
|
|
|
SELECT x FROM nullable_alter ORDER BY x;
|
2017-04-23 07:27:31 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
ALTER TABLE nullable_alter MODIFY COLUMN x Nullable(String);
|
|
|
|
SELECT x FROM nullable_alter ORDER BY x;
|
2017-04-23 07:27:31 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO nullable_alter (x) VALUES ('xyz'), (NULL);
|
|
|
|
SELECT x FROM nullable_alter ORDER BY x NULLS FIRST;
|
2017-04-23 07:27:31 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
ALTER TABLE nullable_alter MODIFY COLUMN x Nullable(FixedString(5));
|
|
|
|
SELECT x FROM nullable_alter ORDER BY x NULLS FIRST;
|
2017-04-23 07:27:31 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE nullable_alter;
|