From 77a3989558fa7032b874b61561dc0f59d3316276 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 20 Feb 2018 15:02:25 +0300 Subject: [PATCH] updated MergeTreePrewhereRangeReader; renamed MergeTreePrewhereRangeReader to MergeTreeRangeReader --- dbms/src/Storages/MergeTree/MergeTreeRangeReader.cpp | 2 +- dbms/src/Storages/MergeTree/MergeTreeRangeReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.cpp b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.cpp index 4d30b7522f8..7e28f20891d 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.cpp @@ -428,7 +428,7 @@ MergeTreeRangeReader::ReadResult MergeTreeRangeReader::startReadingChain(size_t /// result.num_rows_read if the last granule in range also the last in part (so we have to adjust last granule). { size_t space_left = max_rows; - while (space_left && !stream.isFinished() && !ranges.empty()) + while (space_left && (!stream.isFinished() || !ranges.empty())) { if (stream.isFinished()) { diff --git a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h index bcb78b8718c..59fb4c3deb8 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h +++ b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h @@ -114,7 +114,7 @@ public: size_t getNumAddedRows() const { return num_added_rows; } /// The number of filtered rows at all steps in reading chain. size_t getNumFilteredRows() const { return num_filtered_rows; } - /// Filter you need to allply to newly-read columns in order to add them to block. + /// Filter you need to apply to newly-read columns in order to add them to block. const ColumnPtr & getFilter() const { return filter; } void addGranule(size_t num_rows);