fix out-of-bounds

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
This commit is contained in:
Filatenkov Artur 2022-08-31 16:28:10 +03:00 committed by GitHub
parent 941cceda7f
commit 9a231cf49a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,9 +161,9 @@ void MergeTreeIndexAggregatorAnnoy::update(const Block & block, size_t * pos, si
index->add_item(index->get_n_items(), array.data());
/// add all rows from 1 to num_rows - 1 (this is the same as the beginning of the last element)
for (size_t current_row = 0; current_row < num_rows; ++current_row)
for (size_t current_row = 1; current_row < num_rows; ++current_row)
{
index->add_item(index->get_n_items(), &array[offsets[current_row]]);
index->add_item(index->get_n_items(), &array[offsets[current_row - 1]]);
}
}
else