From 99f1aa65b310ee0c46e73e55adee5963f09df031 Mon Sep 17 00:00:00 2001 From: Anastasiya Rodigina Date: Sun, 26 May 2019 20:41:51 +0000 Subject: [PATCH] Try 1 to fix tests --- dbms/src/DataStreams/FinishSortingBlockInputStream.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbms/src/DataStreams/FinishSortingBlockInputStream.cpp b/dbms/src/DataStreams/FinishSortingBlockInputStream.cpp index c0a45fc544e..46458f0a407 100644 --- a/dbms/src/DataStreams/FinishSortingBlockInputStream.cpp +++ b/dbms/src/DataStreams/FinishSortingBlockInputStream.cpp @@ -148,8 +148,11 @@ Block FinishSortingBlockInputStream::readImpl() blocks.push_back(block); } - impl = std::make_unique(blocks, description_to_sort, max_merged_block_size, limit); - res = impl->read(); + if (!blocks.empty()) + { + impl = std::make_unique(blocks, description_to_sort, max_merged_block_size, limit); + res = impl->read(); + } } if (res)