```
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;
```
if (write_ahead_log)
        {
            write_ahead_log->shutdown();
            write_ahead_log.reset();
        }
    }
    for (const auto & disk : disks)
    {
        auto new_table_path_parent = parentPath(new_table_path);
        disk->createDirectories(new_table_path_parent);
        disk->moveDirectory(relative_data_path, new_table_path);
    }
    if (!getStorageID().hasUUID())
        getContext()->dropCaches();
    
    for (const auto & part : data_parts_by_info)
    {
        auto & part_mutable = const_cast<IMergeTreeDataPart &>(*part);
        part_mutable.getDataPartStorage().changeRootPath(relative_data_path, new_table_path);
    }
    relative_data_path = new_table_path;
    renameInMemory(new_table_id);
}
void MergeTreeData::renameInMemory(const StorageID & new_table_id)
{
    IStorage::renameInMemory(new_table_id);
    std::atomic_store(&log_name, std::make_shared<String>(new_table_id.getNameForLogs()));
    log = &Poco::Logger::get(*log_name);
}
void MergeTreeData::dropAllData()