Fix unitialized memory

This commit is contained in:
alesapin 2020-06-24 17:12:44 +03:00
parent 751319d0ef
commit 08f5ed6da3

View File

@ -89,7 +89,8 @@ String MergeTreePartition::getID(const Block & partition_key_sample) const
void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffer & out, const FormatSettings & format_settings) const void MergeTreePartition::serializeText(const MergeTreeData & storage, WriteBuffer & out, const FormatSettings & format_settings) const
{ {
const auto & partition_key_sample = storage.getInMemoryMetadataPtr()->getPartitionKey().sample_block; auto metadata_snapshot = storage.getInMemoryMetadataPtr();
const auto & partition_key_sample = metadata_snapshot->getPartitionKey().sample_block;
size_t key_size = partition_key_sample.columns(); size_t key_size = partition_key_sample.columns();
if (key_size == 0) if (key_size == 0)