```
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;
```
{
                ++prev_it;
                ++curr_it;
                continue;
            }
            if ((*curr_it)->contains(**prev_it))
            {
                deactivate_part(prev_it);
                prev_it = curr_it;
                ++curr_it;
            }
            else if ((*prev_it)->contains(**curr_it))
            {
                auto next = std::next(curr_it);
                deactivate_part(curr_it);
                curr_it = next;
            }
            else
            {
                ++prev_it;
                ++curr_it;
            }
        }
    }
    resetObjectColumnsFromActiveParts(part_lock);
    calculateColumnAndSecondaryIndexSizesImpl();
    LOG_DEBUG(log, "Loaded data parts ({} items)", data_parts_indexes.size());
    data_parts_loading_finished = true;
}
static bool isOldPartDirectory(const DiskPtr & disk, const String & directory_path, time_t threshold)