ClickHouse/tests/queries/0_stateless/01061_alter_codec_with_type.sql

20 lines
601 B
MySQL
Raw Normal View History

2020-01-10 15:28:47 +00:00
DROP TABLE IF EXISTS alter_bug;
create table alter_bug (
epoch UInt64 CODEC(Delta,LZ4),
_time_dec Float64
) Engine = MergeTree ORDER BY (epoch);
SELECT name, type, compression_codec FROM system.columns WHERE table='alter_bug' AND database=currentDatabase();
ALTER TABLE alter_bug MODIFY COLUMN epoch DEFAULT toUInt64(_time_dec) CODEC(Delta,LZ4);
SELECT name, type, default_expression, compression_codec FROM system.columns WHERE table='alter_bug' AND database=currentDatabase();
INSERT INTO alter_bug(_time_dec) VALUES(1577351080);
SELECT * FROM alter_bug;
DROP TABLE IF EXISTS alter_bug;