diff --git a/src/Interpreters/HashJoin/HashJoin.cpp b/src/Interpreters/HashJoin/HashJoin.cpp index dfc41a93417..d1fa1280ed8 100644 --- a/src/Interpreters/HashJoin/HashJoin.cpp +++ b/src/Interpreters/HashJoin/HashJoin.cpp @@ -692,12 +692,12 @@ void HashJoin::shrinkStoredBlocksToFit(size_t & total_bytes_in_join, bool force_ for (auto & stored_block : data->blocks) { + doDebugAsserts(); + size_t old_size = stored_block.allocatedBytes(); stored_block = stored_block.shrinkToFit(); size_t new_size = stored_block.allocatedBytes(); - doDebugAsserts(); - if (old_size >= new_size) { if (data->blocks_allocated_size < old_size - new_size)