Fixed bad code #3565

This commit is contained in:
Alexey Milovidov 2018-11-14 04:04:09 +03:00
parent ead153e9e4
commit d1b86225ef

View File

@ -449,11 +449,10 @@ template <>
void FlatDictionary::createAttributeImpl<String>(Attribute & attribute, const Field & null_value) void FlatDictionary::createAttributeImpl<String>(Attribute & attribute, const Field & null_value)
{ {
attribute.string_arena = std::make_unique<Arena>(); attribute.string_arena = std::make_unique<Arena>();
auto & null_value_ref = std::get<StringRef>(attribute.null_values);
const String & string = null_value.get<String>(); const String & string = null_value.get<String>();
const auto string_in_arena = attribute.string_arena->insert(string.data(), string.size()); const char * string_in_arena = attribute.string_arena->insert(string.data(), string.size());
null_value_ref = StringRef{string_in_arena, string.size()}; attribute.null_values.emplace<StringRef>(string_in_arena, string.size());
attribute.arrays.emplace<ContainerType<StringRef>>(initial_array_size, null_value_ref); attribute.arrays.emplace<ContainerType<StringRef>>(initial_array_size, StringRef(string_in_arena, string.size()));
} }