Skip to content

Commit

Permalink
Fix SegmentHeader::clone()
Browse files Browse the repository at this point in the history
Cloning did not copy over all fields. The `MockS3Storage` relies on
cloning segments and this makes it usable for all cases.
  • Loading branch information
IvoDD committed Jan 31, 2025
1 parent 32fa78f commit ff22094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/arcticdb/codec/encoded_field_collection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class EncodedFieldCollection {
EncodedFieldCollection() = default;

[[nodiscard]] EncodedFieldCollection clone() const {
return {data_.clone(), offsets_.clone()};
auto output = EncodedFieldCollection{data_.clone(), offsets_.clone()};
output.count_ = count_;
output.offset_ = offset_;
return output;
}

ARCTICDB_MOVE_ONLY_DEFAULT(EncodedFieldCollection)
Expand Down
1 change: 1 addition & 0 deletions cpp/arcticdb/codec/segment_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class SegmentHeader {
output.header_fields_ = header_fields_.clone();
output.body_fields_ = body_fields_.clone();
output.offset_ = offset_;
output.field_count_ = field_count_;
return output;
}

Expand Down

0 comments on commit ff22094

Please sign in to comment.