ClickHouse/tests/queries/0_stateless/01462_test_codec_on_alias.sql

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

26 lines
930 B
MySQL
Raw Normal View History

2020-08-31 07:12:19 +00:00
DROP TABLE IF EXISTS compression_codec_on_alias;
select 'create table compression_codec_on_alias with CODEC on ALIAS type';
CREATE TABLE compression_codec_on_alias (
`c0` ALIAS c1 CODEC(ZSTD),
c1 UInt64
) ENGINE = MergeTree() PARTITION BY c0 ORDER BY c1; -- { serverError 36 }
2020-08-31 07:12:19 +00:00
select 'create table compression_codec_on_alias with proper CODEC';
CREATE TABLE compression_codec_on_alias (
c0 UInt64 CODEC(ZSTD),
c1 UInt64
) ENGINE = MergeTree() PARTITION BY c0 ORDER BY c1; -- success
select 'alter table compression_codec_on_alias add column (ALIAS type) with CODEC';
2020-08-31 07:12:19 +00:00
ALTER TABLE compression_codec_on_alias ADD COLUMN `c3` ALIAS c2 CODEC(ZSTD) AFTER c2; -- { serverError 36 }
2020-08-31 07:12:19 +00:00
select 'alter table compression_codec_on_alias add column (NOT ALIAS type) with CODEC';
2020-08-31 07:12:19 +00:00
ALTER TABLE compression_codec_on_alias ADD COLUMN c2 UInt64 CODEC(ZSTD) AFTER c1; -- success
DROP TABLE IF EXISTS compression_codec_on_alias;