Add check for nullptr

This commit is contained in:
kssenii 2021-05-19 19:32:04 +00:00
parent 477214a57f
commit 56b388addf

View File

@ -228,6 +228,9 @@ Block MergeTreePartition::executePartitionByExpression(const StorageMetadataPtr
KeyDescription MergeTreePartition::adjustPartitionKey(const StorageMetadataPtr & metadata_snapshot, ContextPtr context)
{
const auto & partition_key = metadata_snapshot->getPartitionKey();
if (!partition_key.definition_ast)
return partition_key;
ASTPtr ast_copy = partition_key.definition_ast->clone();
/// Implementation of modulo function was changed from 8bit result type to 16bit. For backward compatibility partition by expression is always