mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
Don't miss columns TTLs update
This commit is contained in:
parent
c21fac11cc
commit
dd3cf0fe0a
@ -474,8 +474,17 @@ void StorageReplicatedMergeTree::setTableStructure(ColumnsDescription new_column
|
||||
{
|
||||
StorageInMemoryMetadata new_metadata = getInMemoryMetadata();
|
||||
if (new_columns != new_metadata.columns)
|
||||
{
|
||||
new_metadata.columns = new_columns;
|
||||
|
||||
new_metadata.column_ttls_by_name.clear();
|
||||
for (const auto & [name, ast] : new_metadata.columns.getColumnTTLs())
|
||||
{
|
||||
auto new_ttl_entry = TTLDescription::getTTLFromAST(ast, new_metadata.columns, global_context, new_metadata.primary_key);
|
||||
new_metadata.column_ttls_by_name[name] = new_ttl_entry;
|
||||
}
|
||||
}
|
||||
|
||||
if (!metadata_diff.empty())
|
||||
{
|
||||
if (metadata_diff.sorting_key_changed)
|
||||
|
Loading…
Reference in New Issue
Block a user