https://clickhouse-test-reports.s3.yandex.net/18817/9049599e367bcccd809f45af138452f965b3303a/stress_test_(undefined)/test_run.txt.out.log
if (try_resolve(*this))
            return resolved_id;
        
        bool is_local_context = query_context && query_context != this;
        if (is_local_context && try_resolve(*query_context))
            return resolved_id;
        
        bool is_local_or_query_context = session_context && session_context != this;
        if (is_local_or_query_context && try_resolve(*session_context))
            return resolved_id;
    }
    
    if (in_current_database)
    {
        if (current_database.empty())
        {
            if (exception)
                exception->emplace("Default database is not selected", ErrorCodes::UNKNOWN_DATABASE);
            return StorageID::createEmpty();
        }
        storage_id.database_name = current_database;
        
        return storage_id;
    }
    if (exception)
        exception->emplace("Cannot resolve database name for table " + storage_id.getNameForLogs(), ErrorCodes::UNKNOWN_TABLE);
    return StorageID::createEmpty();
}
}