A table definition with an `ALIAS` that references itself is accepted without any warning or error. When querying the aliased column clickhouse-server segfaults.

It occurred for me on 21.4.6.55.

**How to reproduce**
* Use Version 21.4.6.55
* Run these statements:

```sql
CREATE TABLE foo (i Int32, j ALIAS j+1) ENGINE = MergeTree() ORDER BY i;
INSERT INTO foo VALUES (23);
SELECT * FROM foo
┌──i─┐
│ 23 │
└────┘
SELECT * FROM foo WHERE j = 42
[00fc17cc0543] 2021.05.19 16:41:42.120886 [ 168 ] <Fatal> BaseDaemon: ########################################
[00fc17cc0543] 2021.05.19 16:41:42.121084 [ 168 ] <Fatal> BaseDaemon: (version 21.4.6.55 (official build), build id: CFD133A618715680C43AA5458CC9782F35C3B1E7) (from thread 101) (query_id: 398eee86-f3d6-446c-8175-000db227cc49) Received signal Segmentation fault (11)
[00fc17cc0543] 2021.05.19 16:41:42.121193 [ 168 ] <Fatal> BaseDaemon: Address: 0x7f98acbffff8 Access: write. Attempted access has violated the permissions assigned to the memory area.
[00fc17cc0543] 2021.05.19 16:41:42.121322 [ 168 ] <Fatal> BaseDaemon: Stack trace: 0xf043c5b 0xf042ff7 0xf042c3f 0xf2b5c9f 0xf2b5a31 0xf71b253 0xf754dd2 0xf7542b8 0xf754313 0xf754313 0xf754313 0xf754313 0xf754eae 0xf7542b8 0xf754313 0xf754313 0xf754313 0xf754313 0xf754eae 0xf7542b8 0xf754313 0xf754313 0xf754313 0xf754313 0xf754eae 0xf7542b8 0xf754313 0xf754313 0xf754313 0xf754313 0xf754eae
[00fc17cc0543] 2021.05.19 16:41:42.121488 [ 168 ] <Fatal> BaseDaemon: 1. DB::ActionsDAG::addNode(DB::ActionsDAG::Node) @ 0xf043c5b in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.121594 [ 168 ] <Fatal> BaseDaemon: 2. DB::ActionsDAG::addInput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDataType const>) @ 0xf042ff7 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.121666 [ 168 ] <Fatal> BaseDaemon: 3. DB::ActionsDAG::ActionsDAG(DB::NamesAndTypesList const&) @ 0xf042c3f in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.121770 [ 168 ] <Fatal> BaseDaemon: 4. DB::ExpressionAnalyzer::analyzeAggregation() @ 0xf2b5c9f in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.121894 [ 168 ] <Fatal> BaseDaemon: 5. DB::ExpressionAnalyzer::ExpressionAnalyzer(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::TreeRewriterResult const> const&, DB::Context const&, unsigned long, bool, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >) @ 0xf2b5a31 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122024 [ 168 ] <Fatal> BaseDaemon: 6. DB::addTypeConversionToAST(std::__1::shared_ptr<DB::IAST>&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::NamesAndTypesList const&, DB::Context const&) @ 0xf71b253 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122131 [ 168 ] <Fatal> BaseDaemon: 7. DB::ColumnAliasesMatcher::visit(DB::ASTIdentifier&, std::__1::shared_ptr<DB::IAST>&, DB::ColumnAliasesMatcher::Data&) @ 0xf754dd2 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122212 [ 168 ] <Fatal> BaseDaemon: 8. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf7542b8 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122309 [ 168 ] <Fatal> BaseDaemon: 9. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122403 [ 168 ] <Fatal> BaseDaemon: 10. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122503 [ 168 ] <Fatal> BaseDaemon: 11. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122611 [ 168 ] <Fatal> BaseDaemon: 12. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122682 [ 168 ] <Fatal> BaseDaemon: 13. DB::ColumnAliasesMatcher::visit(DB::ASTIdentifier&, std::__1::shared_ptr<DB::IAST>&, DB::ColumnAliasesMatcher::Data&) @ 0xf754eae in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122778 [ 168 ] <Fatal> BaseDaemon: 14. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf7542b8 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122877 [ 168 ] <Fatal> BaseDaemon: 15. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.122982 [ 168 ] <Fatal> BaseDaemon: 16. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123071 [ 168 ] <Fatal> BaseDaemon: 17. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123142 [ 168 ] <Fatal> BaseDaemon: 18. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123238 [ 168 ] <Fatal> BaseDaemon: 19. DB::ColumnAliasesMatcher::visit(DB::ASTIdentifier&, std::__1::shared_ptr<DB::IAST>&, DB::ColumnAliasesMatcher::Data&) @ 0xf754eae in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123342 [ 168 ] <Fatal> BaseDaemon: 20. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf7542b8 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123434 [ 168 ] <Fatal> BaseDaemon: 21. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123522 [ 168 ] <Fatal> BaseDaemon: 22. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123600 [ 168 ] <Fatal> BaseDaemon: 23. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123700 [ 168 ] <Fatal> BaseDaemon: 24. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123789 [ 168 ] <Fatal> BaseDaemon: 25. DB::ColumnAliasesMatcher::visit(DB::ASTIdentifier&, std::__1::shared_ptr<DB::IAST>&, DB::ColumnAliasesMatcher::Data&) @ 0xf754eae in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123884 [ 168 ] <Fatal> BaseDaemon: 26. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf7542b8 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.123978 [ 168 ] <Fatal> BaseDaemon: 27. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.124049 [ 168 ] <Fatal> BaseDaemon: 28. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.124139 [ 168 ] <Fatal> BaseDaemon: 29. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.124238 [ 168 ] <Fatal> BaseDaemon: 30. DB::InDepthNodeVisitor<DB::ColumnAliasesMatcher, false, std::__1::shared_ptr<DB::IAST> >::visit(std::__1::shared_ptr<DB::IAST>&) @ 0xf754313 in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.124337 [ 168 ] <Fatal> BaseDaemon: 31. DB::ColumnAliasesMatcher::visit(DB::ASTIdentifier&, std::__1::shared_ptr<DB::IAST>&, DB::ColumnAliasesMatcher::Data&) @ 0xf754eae in /usr/bin/clickhouse
[00fc17cc0543] 2021.05.19 16:41:42.282099 [ 168 ] <Fatal> BaseDaemon: Checksum of the binary: 34D21D52DBEF5EEECE3EA692751B041B, integrity check passed.

Exception on client:
Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000

Connecting to localhost:9000 as user default.
Code: 210. DB::NetException: Connection refused (localhost:9000)

```

**Expected behavior**
I'd expect either the table definition to be invalid or the query returning an error.
I'd expect the server to not segfault.

table_join.kind != ASTTableJoin::Kind::Cross)
    {
        if (join_default_strictness == JoinStrictness::ANY)
            table_join.strictness = ASTTableJoin::Strictness::Any;
        else if (join_default_strictness == JoinStrictness::ALL)
            table_join.strictness = ASTTableJoin::Strictness::All;
        else
            throw Exception("Expected ANY or ALL in JOIN section, because setting (join_default_strictness) is empty",
                            DB::ErrorCodes::EXPECTED_ALL_OR_ANY);
    }
    if (old_any)
    {
        if (table_join.strictness == ASTTableJoin::Strictness::Any &&
            table_join.kind == ASTTableJoin::Kind::Inner)
        {
            table_join.strictness = ASTTableJoin::Strictness::Semi;
            table_join.kind = ASTTableJoin::Kind::Left;
        }
        if (table_join.strictness == ASTTableJoin::Strictness::Any)
            table_join.strictness = ASTTableJoin::Strictness::RightAny;
    }
    else
    {
        if (table_join.strictness == ASTTableJoin::Strictness::Any)
            if (table_join.kind == ASTTableJoin::Kind::Full)
                throw Exception("ANY FULL JOINs are not implemented.", ErrorCodes::NOT_IMPLEMENTED);
    }
    out_table_join = table_join;
}
void collectJoinedColumns(TableJoin & analyzed_join, const ASTSelectQuery & select_query,