```
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;
```
const MergeTreePartInfo & part_info,
    DataPartState state,
    DataPartsLock & ) const
{
    PartHierarchy result;
    
    auto it_middle = data_parts_by_state_and_info.lower_bound(DataPartStateAndInfo{state, part_info});
    auto committed_parts_range = getDataPartsStateRange(state);
    
    DataPartIteratorByStateAndInfo begin = it_middle;
    while (begin != committed_parts_range.begin())
    {
        auto prev = std::prev(begin);
        if (!part_info.contains((*prev)->info))
        {
            if ((*prev)->info.contains(part_info))
            {
                result.covering_parts.push_back(*prev);
            }
            else if (!part_info.isDisjoint((*prev)->info))
            {
                result.intersected_parts.push_back(*prev);
            }
            break;
        }
        begin = prev;