Update key

This commit is contained in:
alesapin 2020-06-09 20:22:03 +03:00
parent 4c2e0561f5
commit 936cc9d573

View File

@ -313,6 +313,9 @@ void AlterCommand::apply(StorageInMemoryMetadata & metadata, const Context & con
column.default_desc.expression = default_expression; column.default_desc.expression = default_expression;
} }
}); });
if (metadata.sorting_key.sample_block.has(column_name))
metadata.sorting_key = KeyDescription::getKeyFromAST(metadata.sorting_key.definition_ast, metadata.columns, context);
} }
else if (type == MODIFY_ORDER_BY) else if (type == MODIFY_ORDER_BY)
{ {