diff --git a/tests/queries/0_stateless/02478_projection_and_alter_low_cardinality.reference b/tests/queries/0_stateless/02478_projection_and_alter_low_cardinality.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/02478_projection_and_alter_low_cardinality.sql b/tests/queries/0_stateless/02478_projection_and_alter_low_cardinality.sql new file mode 100644 index 00000000000..b811513b3d9 --- /dev/null +++ b/tests/queries/0_stateless/02478_projection_and_alter_low_cardinality.sql @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS testing; + +CREATE TABLE testing +( + a String, + b String, + c String, + d String, + PROJECTION proj_1 + ( + SELECT b, c + ORDER BY d + ) +) +ENGINE = MergeTree() +PRIMARY KEY (a) +ORDER BY (a, b) +SETTINGS index_granularity = 8192, index_granularity_bytes = 0, min_bytes_for_wide_part = 0; + +INSERT INTO testing SELECT randomString(5), randomString(5), randomString(5), randomString(5) FROM numbers(10); + +OPTIMIZE TABLE testing FINAL; + +ALTER TABLE testing MODIFY COLUMN c LowCardinality(String) SETTINGS mutations_sync=2; + +SELECT * FROM system.mutations WHERE database = currentDatabase() AND table = 'testing' AND not is_done; + +DROP TABLE testing;