https://clickhouse-test-reports.s3.yandex.net/18817/9049599e367bcccd809f45af138452f965b3303a/stress_test_(undefined)/test_run.txt.out.log
}
    if (table_id.database_name == TEMPORARY_DATABASE)
    {
        
        
        
        if (exception)
            exception->emplace(ErrorCodes::DATABASE_ACCESS_DENIED, "Direct access to `{}` database is not allowed", String(TEMPORARY_DATABASE));
        return {};
    }
    DatabasePtr database;
    {
        std::lock_guard lock{databases_mutex};
        auto it = databases.find(table_id.getDatabaseName());
        if (databases.end() == it)
        {
            if (exception)
                exception->emplace(ErrorCodes::UNKNOWN_DATABASE, "Database {} doesn't exist", backQuoteIfNeed(table_id.getDatabaseName()));
            return {};
        }
        database = it->second;
    }
    auto table = database->tryGetTable(table_id.table_name, context);
    if (!table && exception)
            exception->emplace(ErrorCodes::UNKNOWN_TABLE, "Table {} doesn't exist", table_id.getNameForLogs());
    if (!table)
        database = nullptr;
    return {database, table};
}
void DatabaseCatalog::assertDatabaseExists(const String & database_name) const