mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Recalculate always projections on mutations in ReplicatedMergeTree
This commit is contained in:
parent
67bb647a54
commit
b832840cf3
@ -456,6 +456,14 @@ StorageInMemoryMetadata ReplicatedMergeTreeTableMetadata::Diff::getNewMetadata(c
|
||||
new_metadata.table_ttl = TTLTableDescription::getTTLForTableFromAST(
|
||||
new_metadata.table_ttl.definition_ast, new_metadata.columns, context, new_metadata.primary_key);
|
||||
|
||||
if (!projections_changed)
|
||||
{
|
||||
ProjectionsDescription recalculated_projections;
|
||||
for (const auto & projection : new_metadata.projections)
|
||||
recalculated_projections.add(ProjectionDescription::getProjectionFromAST(projection.definition_ast, new_metadata.columns, context));
|
||||
new_metadata.projections = std::move(recalculated_projections);
|
||||
}
|
||||
|
||||
return new_metadata;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS 02691_drop_column_replicated;
|
||||
|
||||
CREATE TABLE 02691_drop_column_replicated (col1 Int64, col2 Int64, PROJECTION 02691_drop_column_replicated (SELECT * ORDER BY col1 ))
|
||||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/test/02691_drop_column', 'r1')
|
||||
ORDER BY col1;
|
||||
|
||||
INSERT INTO 02691_drop_column_replicated VALUES (1, 2);
|
||||
|
||||
ALTER TABLE 02691_drop_column_replicated DROP COLUMN col2 SETTINGS alter_sync = 2;
|
||||
|
||||
DROP TABLE 02691_drop_column_replicated;
|
Loading…
Reference in New Issue
Block a user