After such successful queries:

```sql
CREATE DATABASE testlazy ENGINE = Lazy(1);
CREATE TABLE testlazy.`таблица_со_странным_названием` (a UInt64, b UInt64) ENGINE = Log;
```
Server failed to restart with error:
```
<Error> Application: filesystem error: in posix_stat: failed to determine attributes for the specified path: File name too long [/home/avogar/tmp/server/metadata/testlazy/%25D1%2582%25D0%25B0%25D0%25B1%25D0%25BB%25D0%25B8%25D1%2586%25D0%25B0_%25D1%2581%25D0%25BE_%25D1%2581%25D1%2582%25D1%2580%25D0%25B0%25D0%25BD%25D0%25BD%25D1%258B%25D0%25BC_%25D0%25BD%25D0%25B0%25D0%25B7%25D0%25B2%25D0%25B0%25D0%25BD%25D0%25B8%25D0%25B5%25D0%25BC.sql]
```

Found in https://github.com/ClickHouse/ClickHouse/pull/27928
{
    std::lock_guard lock(mutex);
    auto time_now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
    CacheExpirationQueue expired_tables;
    auto expired_it = cache_expiration_queue.begin();
    while (expired_it != cache_expiration_queue.end() && (time_now - expired_it->last_touched) >= expiration_time)
        ++expired_it;
    expired_tables.splice(expired_tables.end(), cache_expiration_queue, cache_expiration_queue.begin(), expired_it);
    CacheExpirationQueue busy_tables;
    while (!expired_tables.empty())
    {
        String table_name = expired_tables.front().table_name;
        auto it = tables_cache.find(table_name);
        if (!it->second.table || it->second.table.unique())
        {
            LOG_DEBUG(log, "Drop table {} from cache.", backQuote(it->first));
            it->second.table.reset();
            expired_tables.erase(it->second.expiration_iterator);
            it->second.expiration_iterator = cache_expiration_queue.end();
        }
        else
        {
            LOG_DEBUG(log, "Table {} is busy.", backQuote(it->first));
            busy_tables.splice(busy_tables.end(), expired_tables, it->second.expiration_iterator);
        }
    }
    cache_expiration_queue.splice(cache_expiration_queue.begin(), busy_tables, busy_tables.begin(), busy_tables.end());
}
DatabaseLazyIterator::DatabaseLazyIterator(const DatabaseLazy & database_, Strings && table_names_)