ClickHouse/tests/queries/0_stateless/00121_drop_column_zookeeper.sql

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

28 lines
989 B
MySQL
Raw Normal View History

2024-04-17 14:48:48 +00:00
-- Tags: zookeeper, no-replicated-database, no-shared-merge-tree
2021-09-12 12:35:27 +00:00
-- Tag no-replicated-database: Old syntax is not allowed
2024-04-17 14:48:48 +00:00
-- no-shared-merge-tree: implemented replacement
2021-09-12 12:35:27 +00:00
DROP TABLE IF EXISTS alter_00121 SYNC;
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE alter_00121 (d Date, x UInt8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/test/alter_00121/t1', 'r1', d, (d), 8192);
2019-06-03 17:36:27 +00:00
INSERT INTO alter_00121 VALUES ('2014-01-01', 1);
ALTER TABLE alter_00121 DROP COLUMN x;
DROP TABLE alter_00121 SYNC;
CREATE TABLE alter_00121 (d Date) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/test/alter_00121/t2', 'r1', d, (d), 8192);
2019-06-03 17:36:27 +00:00
INSERT INTO alter_00121 VALUES ('2014-01-01');
SELECT * FROM alter_00121 ORDER BY d;
2019-06-03 17:36:27 +00:00
ALTER TABLE alter_00121 ADD COLUMN x UInt8;
2019-06-03 17:36:27 +00:00
INSERT INTO alter_00121 VALUES ('2014-02-01', 1);
SELECT * FROM alter_00121 ORDER BY d;
2019-06-03 17:36:27 +00:00
ALTER TABLE alter_00121 DROP COLUMN x;
SELECT * FROM alter_00121 ORDER BY d;
DROP TABLE alter_00121 SYNC;