Fix for "out of bound" in ColumnVector::insertRangeFrom called from shrink()

This commit is contained in:
Alexander Gololobov 2022-10-28 13:02:06 +02:00
parent 79874e8733
commit abbb58107c

View File

@ -403,7 +403,8 @@ void MergeTreeRangeReader::ReadResult::optimize(bool can_read_incomplete_granule
filter_original = filter;
/// Check if const 1 after shrink
if (allow_filter_columns && filter.countBytesInFilter() + total_zero_rows_in_tails == total_rows_per_granule)
if (num_rows == filter.size() &&
allow_filter_columns && filter.countBytesInFilter() + total_zero_rows_in_tails == total_rows_per_granule)
{
total_rows_per_granule = total_rows_per_granule - total_zero_rows_in_tails;
num_rows = total_rows_per_granule;