Easy to reproduce:
### 20.3.13
```
SELECT 1
FORMAT JSON

{
        "meta":
        [
                {
                        "name": "1",
                        "type": "UInt8"
                }
        ],

        "data":
        [
                {
                        "1": 1
                }
        ],

        "rows": 1,

        "statistics":
        {
                "elapsed": 0.000203731,
                "rows_read": 1,
                "bytes_read": 1
        }
}
```

### 20.4.5
```
:) select 1 format JSON

SELECT 1
FORMAT JSON

{
        "meta":
        [
                {
                        "name": "1",
                        "type": "UInt8"
                }
        ],

        "data":
        [
                {
                        "1": 1
>>>>>>>> no closing bracket <<<<<<<<<<
        ],

        "rows": 1,

        "statistics":
        {
                "elapsed": 0.000771732,
                "rows_read": 1,
                "bytes_read": 1
        }
}
```
### master
```

SELECT 1
FORMAT JSON

{
        "meta":
        [
                {
                        "name": "1",
                        "type": "UInt8"
                }
        ],

        "data":
        [
                {
                        "1": 1
>>>>>>>> no closing bracket <<<<<<<<<<
        ],

        "rows": 1,

        "statistics":
        {
                "elapsed": 0.00103364,
                "rows_read": 1,
                "bytes_read": 1
        }
}

```

std::optional<Settings> old_settings
            SCOPE_EXIT({ if (old_settings) context.setSettings(*old_settings) )
            auto apply_query_settings = [&](const IAST & settings_ast)
            {
                if (!old_settings)
                    old_settings.emplace(context.getSettingsRef())
                context.applySettingsChanges(settings_ast.as<ASTSetQuery>()->changes)
            
            const auto * insert = parsed_query->as<ASTInsertQuery>()
            if (insert && insert->settings_ast)
                apply_query_settings(*insert->settings_ast)
            /// FIXME: try to prettify this st using `as<>()`
            const auto * ith_output = dynamic_st<const ASTQueryWithOutput *>(parsed_query.get())
            if (ith_output && ith_output->settings_ast)
                apply_query_settings(*ith_output->settings_ast)
            connection->forceConnected(connection_parameters.timeouts)
            ASTPtr input_function
            if (insert && insert->select)
                insert->tryFindInputFunction(input_function)
            /// INSERT query for hich da transfer is needed (not an INSERT SELECT or input()) is processed separately.
            if (insert && (!insert->select || input_function) && !insert->atch)
            {
                if (input_function && insert->format.empty())
                    thro Exception("FORMAT must be specified for function input()", ErrorCodes::INVALID_USAGE_OF_INPUT)
                processInsertQuery()
            
            else
                processOrdinaryQuery()
        
        /// Do not change context (current DB, settings) in se of an exception.