ClickHouse/tests/queries/0_stateless/01135_default_and_alter_zookeeper.sql

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

30 lines
781 B
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: zookeeper
DROP TABLE IF EXISTS default_table SYNC;
CREATE TABLE default_table
(
id UInt64,
enum_column Enum8('undefined' = 0, 'fox' = 1, 'index' = 2)
)
ENGINE ReplicatedMergeTree('/clickhouse/{database}/test_01135/default_table', '1')
ORDER BY tuple();
INSERT INTO default_table VALUES(1, 'index'), (2, 'fox');
ALTER TABLE default_table MODIFY COLUMN enum_column Enum8('undefined' = 0, 'fox' = 1, 'index' = 2) DEFAULT 'undefined';
INSERT INTO default_table (id) VALUES(3), (4);
DETACH TABLE default_table;
ATTACH TABLE default_table;
SELECT COUNT() from default_table;
ALTER TABLE default_table MODIFY COLUMN enum_column Enum8('undefined' = 0, 'fox' = 1, 'index' = 2) DEFAULT 'fox';
SHOW CREATE TABLE default_table;
DROP TABLE IF EXISTS default_table SYNC;