mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added a test
This commit is contained in:
parent
678d127503
commit
c2615d0437
@ -0,0 +1,42 @@
|
||||
hello test
|
||||
1_1_1_0 hello 1
|
||||
hello test
|
||||
goodbye test
|
||||
3_2_2_1 goodbye 3
|
||||
1_1_1_1 hello 1
|
||||
1 test
|
||||
3 test
|
||||
111 abc
|
||||
1_1_1_2 1 1
|
||||
111_3_3_1 111 111
|
||||
3_2_2_2 3 3
|
||||
-1111 def
|
||||
1 test
|
||||
3 test
|
||||
111 abc
|
||||
-1111_5_5_1 -1111 -1111
|
||||
1_1_1_3_4 1 1
|
||||
111_3_3_2_4 111 111
|
||||
3_2_2_3_4 3 3
|
||||
-11112222 ghi
|
||||
-1111 def
|
||||
1 test
|
||||
3 test
|
||||
111 abc
|
||||
-1111_5_5_2_6 -1111 -1111
|
||||
-11112222_7_7_1 -11112222 -11112222
|
||||
1_1_1_4_6 1 1
|
||||
111_3_3_3_6 111 111
|
||||
3_2_2_4_6 3 3
|
||||
-1111222233334444 jkl
|
||||
-11112222 ghi
|
||||
-1111 def
|
||||
1 test
|
||||
3 test
|
||||
111 abc
|
||||
-1111_5_5_3_8 -1111 -1111
|
||||
-11112222_7_7_2_8 -11112222 -11112222
|
||||
-1111222233334444_9_9_1 -1111222233334444 -1111222233334444
|
||||
1_1_1_5_8 1 1
|
||||
111_3_3_4_8 111 111
|
||||
3_2_2_5_8 3 3
|
@ -3,10 +3,47 @@ CREATE TABLE test (x Enum('hello' = 1, 'world' = 2), y String) ENGINE = MergeTre
|
||||
INSERT INTO test VALUES ('hello', 'test');
|
||||
|
||||
SELECT * FROM test;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Enum('hello' = 1, 'world' = 2, 'goodbye' = 3);
|
||||
INSERT INTO test VALUES ('goodbye', 'test');
|
||||
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
SELECT * FROM test ORDER BY x;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Int8;
|
||||
INSERT INTO test VALUES (111, 'abc');
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
SELECT * FROM test ORDER BY x;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Enum8('' = 1); -- { serverError 524 }
|
||||
ALTER TABLE test MODIFY COLUMN x Enum16('' = 1); -- { serverError 524 }
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Int16;
|
||||
INSERT INTO test VALUES (-1111, 'def');
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
SELECT * FROM test ORDER BY x;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Date; -- { serverError 524 }
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Int32;
|
||||
INSERT INTO test VALUES (-11112222, 'ghi');
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
SELECT * FROM test ORDER BY x;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x DateTime; -- { serverError 524 }
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x Int64;
|
||||
INSERT INTO test VALUES (-1111222233334444, 'jkl');
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
SELECT * FROM test ORDER BY x;
|
||||
SELECT name, partition, partition_id FROM system.parts WHERE database = currentDatabase() AND table = 'test' AND active ORDER BY partition;
|
||||
|
||||
ALTER TABLE test MODIFY COLUMN x UInt64; -- { serverError 524 }
|
||||
ALTER TABLE test MODIFY COLUMN x String; -- { serverError 524 }
|
||||
ALTER TABLE test MODIFY COLUMN x Nullable(Int64); -- { serverError 524 }
|
||||
|
||||
DROP TABLE test;
|
||||
|
Loading…
Reference in New Issue
Block a user