mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Added test for ALTERing Nullable columns [#CLICKHOUSE-4].
This commit is contained in:
parent
f32862be60
commit
69d7432f31
@ -0,0 +1,12 @@
|
||||
Hello
|
||||
World
|
||||
Hello
|
||||
World
|
||||
\N
|
||||
Hello
|
||||
World
|
||||
xyz
|
||||
\N
|
||||
Hello
|
||||
World
|
||||
xyz\0\0
|
16
dbms/tests/queries/0_stateless/00456_alter_nullable.sql
Normal file
16
dbms/tests/queries/0_stateless/00456_alter_nullable.sql
Normal file
@ -0,0 +1,16 @@
|
||||
DROP TABLE IF EXISTS test.nullable_alter;
|
||||
CREATE TABLE test.nullable_alter (d Date DEFAULT '2000-01-01', x String) ENGINE = MergeTree(d, d, 1);
|
||||
|
||||
INSERT INTO test.nullable_alter (x) VALUES ('Hello'), ('World');
|
||||
SELECT x FROM test.nullable_alter ORDER BY x;
|
||||
|
||||
ALTER TABLE test.nullable_alter MODIFY COLUMN x Nullable(String);
|
||||
SELECT x FROM test.nullable_alter ORDER BY x;
|
||||
|
||||
INSERT INTO test.nullable_alter (x) VALUES ('xyz'), (NULL);
|
||||
SELECT x FROM test.nullable_alter ORDER BY x NULLS FIRST;
|
||||
|
||||
ALTER TABLE test.nullable_alter MODIFY COLUMN x Nullable(FixedString(5));
|
||||
SELECT x FROM test.nullable_alter ORDER BY x NULLS FIRST;
|
||||
|
||||
DROP TABLE test.nullable_alter;
|
Loading…
Reference in New Issue
Block a user