20.10.1.4853

```sql
drop table if exists xp;
drop table if exists xp_d;

create table xp(A Date, B Int64, S String) Engine=MergeTree partition by toYYYYMM(A) order by B;
insert into xp select '2020-01-01', number , '' from numbers(100000);
insert into xp select '2020-10-01', number , '' from numbers(100000);
create table xp_d as xp Engine=Distributed(test_shard_localhost, currentDatabase(), xp);

select count() from xp_d prewhere toYYYYMM(A) global in (select toYYYYMM(min(A)) from xp_d) where B > -1;
┌─count()─┐
│       0 │     <------ expected 100000
└─────────┘

-- global in & both predicates in prewhere 
select count() from xp_d prewhere toYYYYMM(A) global in (select toYYYYMM(min(A)) from xp_d) and B > -1;
┌─count()─┐
│  100000 │
└─────────┘

-- global in & both predicates in where 
select count() from xp_d where toYYYYMM(A) global in (select toYYYYMM(min(A)) from xp_d) and B > -1;
┌─count()─┐
│  100000 │
└─────────┘

-- not global
select count() from xp_d prewhere toYYYYMM(A) in (select toYYYYMM(min(A)) from xp_d) where B > -1;
┌─count()─┐
│  100000 │
└─────────┘



select count() from xp_d prewhere toYYYYMM(A) global in (select 202001) where B > -1;
┌─count()─┐
│       0 │
└─────────┘
```

hmm, it worked in 19.13.7.57
* returned by getColumnName is not enough, and we have to use the
             * column id set by EA. In principle, this logic applies to all kinds
             * of columns, not only literals. Literals are especially problematic
             * for two reasons:
             * 1) confusing different literal columns leads to weird side
             *    effects (see 01101_literal_columns_clash);
             * 2) the disambiguation mechanism in SyntaxAnalyzer, that, among
             *    other things, creates unique aliases for columns with same
             *    names from different tables, is applied before these temporary
             *    columns are created by ExpressionAnalyzer.
             * Similar problems should also manifest for function columns, which
             * are likewise created at a later stage by EA.
             * In general, we need to have explicit separation between display
             * names and identifiers for columns. This code is a workaround for
             * a particular subclass of problems, and not a proper solution.
             */
            if (const auto * as_literal = ast->as<ASTLiteral>())
            {
                source_name = as_literal->unique_column_name;
                assert(!source_name.empty());
            }
            result_columns.emplace_back(source_name, result_name);
            step.required_output.push_back(result_columns.back().second);
        }
    }
    auto actions = chain.getLastActions();
    actions->add(ExpressionAction::project(result_columns));
    return actions;
}
void ExpressionAnalyzer::appendExpression(ExpressionActionsChain & chain, const ASTPtr & expr, bool only_types)