Fix compact parts as well

This commit is contained in:
alesapin 2022-01-30 22:36:19 +03:00
parent 4bedcc19b5
commit 4f1b902342

View File

@ -277,8 +277,11 @@ void MergeTreeReaderCompact::seekToMark(size_t row_index, size_t column_index)
void MergeTreeReaderCompact::adjustUpperBound(size_t last_mark) void MergeTreeReaderCompact::adjustUpperBound(size_t last_mark)
{ {
auto right_offset = marks_loader.getMark(last_mark).offset_in_compressed_file; size_t right_offset = 0;
if (!right_offset) if (last_mark < data_part->getMarksCount()) /// Otherwise read until the end of file
right_offset = marks_loader.getMark(last_mark).offset_in_compressed_file;
if (right_offset == 0)
{ {
/// If already reading till the end of file. /// If already reading till the end of file.
if (last_right_offset && *last_right_offset == 0) if (last_right_offset && *last_right_offset == 0)