From e433e686105f3dc62d6d4a17c765c5dfdcfc5b19 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Wed, 21 Jun 2017 14:22:02 +0200 Subject: [PATCH] partition_entry: Make squashed() and upgrade() work with not fully continuous versions Those methods first create a neutral mutation_partition, and left-fold it with the versions. The problem is that there is no neutral element for static row continuity, the flag from the first addend always wins. We have to copy the flag from the first version to preserve the logical value. --- partition_version.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/partition_version.cc b/partition_version.cc index b41c5d686c..6820417498 100644 --- a/partition_version.cc +++ b/partition_version.cc @@ -581,6 +581,7 @@ void partition_entry::apply_to_incomplete(const schema& s, partition_version* ve mutation_partition partition_entry::squashed(schema_ptr from, schema_ptr to) { mutation_partition mp(to); + mp.set_static_row_continuous(_version->partition().static_row_continuous()); for (auto&& v : _version->all_elements()) { mp.apply(*to, v.partition(), *from); } @@ -595,6 +596,7 @@ mutation_partition partition_entry::squashed(const schema& s) void partition_entry::upgrade(schema_ptr from, schema_ptr to) { auto new_version = current_allocator().construct(mutation_partition(to)); + new_version->partition().set_static_row_continuous(_version->partition().static_row_continuous()); try { for (auto&& v : _version->all_elements()) { new_version->partition().apply(*to, v.partition(), *from);