https://clickhouse-test-reports.s3.yandex.net/18817/9049599e367bcccd809f45af138452f965b3303a/stress_test_(undefined)/test_run.txt.out.log
return storage_id;
    }
    bool look_for_external_table = where & StorageNamespace::ResolveExternal;
    bool in_current_database = where & StorageNamespace::ResolveCurrentDatabase;
    bool in_specified_database = where & StorageNamespace::ResolveGlobal;
    if (!storage_id.database_name.empty())
    {
        if (in_specified_database)
            return storage_id;     
        if (exception)
            exception->emplace("External and temporary tables have no database, but " +
                        storage_id.database_name + " is specified", ErrorCodes::UNKNOWN_TABLE);
        return StorageID::createEmpty();
    }
    
    if (look_for_external_table)
    {
        
        assert(global_context != this || getApplicationType() == ApplicationType::LOCAL);
        auto resolved_id = StorageID::createEmpty();
        auto try_resolve = [&](const Context & context) -> bool
        {
            const auto & tables = context.external_tables_mapping;
            auto it = tables.find(storage_id.getTableName());
            if (it == tables.end())
                return false;
            resolved_id = it->second->getGlobalTableID();
            return true;
        };