mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
dbms: FlatDictionary: fix off-by-one error on resize. [#METR-13298]
This commit is contained in:
parent
33f41657df
commit
f321a422b7
@ -262,7 +262,7 @@ private:
|
|||||||
{
|
{
|
||||||
auto & array = *std::get<std::unique_ptr<PODArray<T>>>(attribute.arrays);
|
auto & array = *std::get<std::unique_ptr<PODArray<T>>>(attribute.arrays);
|
||||||
if (id >= array.size())
|
if (id >= array.size())
|
||||||
array.resize_fill(id, std::get<T>(attribute.null_values));
|
array.resize_fill(id + 1, std::get<T>(attribute.null_values));
|
||||||
array[id] = value;
|
array[id] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ private:
|
|||||||
{
|
{
|
||||||
auto & array = *std::get<std::unique_ptr<PODArray<StringRef>>>(attribute.arrays);
|
auto & array = *std::get<std::unique_ptr<PODArray<StringRef>>>(attribute.arrays);
|
||||||
if (id >= array.size())
|
if (id >= array.size())
|
||||||
array.resize_fill(id, std::get<String>(attribute.null_values));
|
array.resize_fill(id + 1, std::get<String>(attribute.null_values));
|
||||||
const auto & string = value.get<String>();
|
const auto & string = value.get<String>();
|
||||||
const auto string_in_arena = attribute.string_arena->insert(string.data(), string.size());
|
const auto string_in_arena = attribute.string_arena->insert(string.data(), string.size());
|
||||||
array[id] = StringRef{string_in_arena, string.size()};
|
array[id] = StringRef{string_in_arena, string.size()};
|
||||||
|
Loading…
Reference in New Issue
Block a user