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.
This commit is contained in:
Tomasz Grabiec
2017-06-21 14:22:02 +02:00
parent b680de930c
commit e433e68610

View File

@@ -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<partition_version>(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);