```
CREATE TABLE t (x UInt8, PROJECTION p (SELECT x GROUP BY x)) ENGINE = MergeTree ORDER BY ();
INSERT INTO t VALUES (0);

SET group_by_overflow_mode = 'any', max_rows_to_group_by = 1000, totals_mode = 'after_having_auto';
SELECT x FROM t GROUP BY x WITH TOTALS;
```
(*it)->name, (*it)->version.removal_tid_lock);
            addPartContributionToColumnAndSecondaryIndexSizes(*it);
            addPartContributionToDataVolume(*it);
            modifyPartState(it, DataPartState::Active); 
            restored_active_part = true;
        };
        auto it_middle = data_parts_by_info.lower_bound(part->info);
        
        if (it_middle != data_parts_by_info.begin())
        {
            auto it = std::prev(it_middle);
            if (part->contains(**it) && is_appropriate_state((*it)->getState()))
            {
                
                if ((*it)->info.min_block != part->info.min_block)
                    update_error(it);
                if ((*it)->getState() != DataPartState::Active)
                    activate_part(it);
                pos = (*it)->info.max_block + 1;
                restored.push_back((*it)->name);
            }
            else if ((*it)->info.partition_id == part->info.partition_id)
                update_error(it);
            else
                error = true;
        }
        else
            error = true;
        
        for (auto it = it_middle; it != data_parts_by_info.end() && part->contains(**it); ++it)