**How to reproduce**

Query:
```sql
select
	x,
	min(x) as lower,
	max(x)+1 as upper,
	upper-lower as range
from (select arrayJoin([1, 2]) as x)
group by x
with rollup;
```

## 20.4.6
```
┌─x─┬─lower─┬─upper─┬─range─┐
│ 1 │     1 │     2 │     1 │
│ 2 │     2 │     3 │     1 │
└───┴───────┴───────┴───────┘
┌─x─┬─lower─┬─upper─┬─range─┐
│ 0 │     1 │     3 │     2 │
└───┴───────┴───────┴───────┘
```
Summary looks correct.

## 20.9.3
```
┌─x─┬─lower─┬─upper─┬─range─┐
│ 1 │     1 │     2 │     1 │
│ 2 │     2 │     3 │     1 │
└───┴───────┴───────┴───────┘
┌─x─┬─lower─┬─upper─┬─range─┐
│ 0 │     0 │     3 │     2 │
└───┴───────┴───────┴───────┘
```
`lower` is wrong - the minimum should be 1. However, all other "derived" values are correct. For example `range` correctly shows up as 2, even though table would wrongly imply that `upper-lower==3-0==3`.
Note that I only tested 20.4.6 and 20.9.3, so the regression might have been anywhere in between.

## 20.10.2
```
┌─x─┬─lower─┬─upper─┬─range─┐
│ 1 │     1 │     2 │     1 │
│ 2 │     2 │     3 │     1 │
└───┴───────┴───────┴───────┘
┌─x─┬─lower─┬─upper─┬─range─┐
│ 0 │     0 │     1 │     1 │
└───┴───────┴───────┴───────┘
```
All values are wrong.
{
    const FunctionFactory & function_factory = FunctionFactory::instance();
    if (!select_query->groupBy())
    {
        
        if (select_query->having())
            appendUnusedGroupByColumn(select_query, source_columns);
        return;
    }
    const auto is_literal = [] (const ASTPtr & ast) -> bool
    {
        return ast->as<ASTLiteral>();
    };
    auto & group_exprs = select_query->groupBy()->children;
    
    const auto remove_expr_at_index = [&group_exprs] (const size_t idx)
    {
        if (idx < group_exprs.size() - 1)
            std::swap(group_exprs[idx], group_exprs.back());
        group_exprs.pop_back();
    };
    
    for (size_t i = 0; i < group_exprs.size();)
    {
        if (const auto * function = group_exprs[i]->as<ASTFunction>())
        {
            
            if (possibly_injective_function_names.count(function->name))
            {