diff --git a/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.reference b/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.reference index e4c3e8a5a9f..ec0bd231cca 100644 --- a/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.reference +++ b/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.reference @@ -5,7 +5,7 @@ CODEC(ZSTD) 2018-01-01 2 default_value 2018-01-01 3 3 2018-01-01 4 4 -CODEC(NODE) +CODEC(NONE) 2018-01-01 1 default_value 2018-01-01 2 default_value 2018-01-01 3 3 @@ -18,3 +18,12 @@ CODEC(NODE) 2018-01-01 4 4 2018-01-01 5 5 2018-01-01 6 6 +CODEC(ZSTD,LZ4HC,LZ4,LZ4,NONE) +2018-01-01 1 default_value +2018-01-01 2 default_value +2018-01-01 3 3 +2018-01-01 4 4 +2018-01-01 5 5 +2018-01-01 6 6 +2018-01-01 7 7 +2018-01-01 8 8 diff --git a/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.sql b/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.sql index fff28c1f19b..f5420f4710c 100644 --- a/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.sql +++ b/dbms/tests/queries/0_stateless/00804_test_alter_compression_codecs.sql @@ -28,4 +28,25 @@ SELECT * FROM test.alter_compression_codec ORDER BY id; OPTIMIZE TABLE test.alter_compression_codec FINAL; SELECT * FROM test.alter_compression_codec ORDER BY id; +ALTER TABLE test.alter_compression_codec MODIFY COLUMN alter_column CODEC(ZSTD, LZ4HC, LZ4, LZ4, NONE); +SELECT compression_codec FROM system.columns WHERE database = 'test' AND table = 'alter_compression_codec' AND name = 'alter_column'; + +INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 7, '7'); +INSERT INTO test.alter_compression_codec VALUES('2018-01-01', 8, '8'); +OPTIMIZE TABLE test.alter_compression_codec FINAL; +SELECT * FROM test.alter_compression_codec ORDER BY id; + DROP TABLE IF EXISTS test.alter_compression_codec; + +DROP TABLE IF EXISTS test.alter_bad_codec; + +CREATE TABLE test.alter_bad_codec ( + somedate Date CODEC(LZ4), + id UInt64 CODEC(NONE) +) ENGINE = MergeTree() ORDER BY tuple(); + +ALTER TABLE test.alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(gbdgkjsdh); -- { serverError 432 } + +ALTER TABLE test.alter_bad_codec ADD COLUMN alter_column DateTime DEFAULT '2019-01-01 00:00:00' CODEC(ZSTD(100)); -- { serverError 433 } + +DROP TABLE IF EXISTS test.alter_bad_codec;