```
cat /etc/clickhouse-client/conf.d/propmt.xml
<config>
    <prompt_by_server_display_name>
	    <default>{database}@{host} :) </default>
    </prompt_by_server_display_name>
</config>


cat /etc/clickhouse-server/conf.d/default_database.xml
<?xml version="1.0"?>
<yandex>
    <default_database>dw</default_database>
</yandex>

$ clickhouse-client
ClickHouse client version 21.6.5.37 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.6.5 revision 54448.

default@localhost :) select currentDatabase();

SELECT currentDatabase()

Query id: efd2952e-a0d5-4250-be3c-5c3a929d3256

┌─currentDatabase()─┐
│ dw                │
└───────────────────┘
```

now: `default@localhost :)`
expected: `dw@localhost :)`
/// FIXME: try to prettify this cast using `as<>()`
        const auto * with_output = dynamic_cast<const ASTQueryWithOutput *>(parsed_query.get());
        if (with_output && with_output->settings_ast)
            apply_query_settings(*with_output->settings_ast);
        if (!connection->checkConnected(connection_parameters.timeouts))
            connect();
        ASTPtr input_function;
        if (insert && insert->select)
            insert->tryFindInputFunction(input_function);
        bool is_async_insert = global_context->getSettingsRef().async_insert && insert && insert->hasInlinedData();
        /// INSERT query for which data transfer is needed (not an INSERT SELECT or input()) is processed separately.
        if (insert && (!insert->select || input_function) && !insert->watch && !is_async_insert)
        {
            if (input_function && insert->format.empty())
                throw Exception("FORMAT must be specified for function input()", ErrorCodes::INVALID_USAGE_OF_INPUT);
            processInsertQuery(query_to_execute, parsed_query);
        }
        else
            processOrdinaryQuery(query_to_execute, parsed_query);
    }
    /// Do not change context (current DB, settings) in case of an exception.
    if (!have_error)
    {
        if (const auto * set_query = parsed_query->as<ASTSetQuery>())
        {
            /// Save all changes in settings to avoid losing them if the connection is lost.
            for (const auto & change : set_query->changes)
            {
                if (change.name == "profile")
                    current_profile = change.value.safeGet<String>();