```
:) CREATE TABLE table_for_dict (`key_column` UInt64, `second_column` UInt8, `third_column` String) ENGINE = MergeTree ORDER BY key_column
:) INSERT INTO table_for_dict VALUES (1, 100, 'Hello world');
:) CREATE DICTIONARY dict1　(　  key_column UInt64 DEFAULT 0,　  second_column UInt8 DEFAULT 1,　  third_column String DEFAULT 'qqq'　)　PRIMARY KEY key_column　SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'default'))　LIFETIME(MIN 1 MAX 10)　LAYOUT(FLAT());
:) create table t1 (n default dictGetUInt8('default.dict1', 'second_column', toUInt64(100500)), m default dictGet(default.dict1, 'third_column', toUInt64(100500))) engine=Memory
```

Works fine on 20.8.19:
```
:) insert into t1(n) values (1)
:) select * from t1
```

Fails on 21.10.1.1 (master):
```
:) insert into t1(n) values (1)

INSERT INTO t1 (n) VALUES

Query id: abfdc400-0844-41a5-840e-ba1eded588ba

[avtokmakov-dev.sas.yp-c.yandex.net] 2021.08.25 14:57:24.963404 [ 6061 ] {abfdc400-0844-41a5-840e-ba1eded588ba} <Debug> executeQuery: (from [::1]:55432) insert into t1(n) values 
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.08.25 14:57:24.965070 [ 6061 ] {abfdc400-0844-41a5-840e-ba1eded588ba} <Trace> ContextAccess (default): Access granted: INSERT(n) ON default.t1
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.08.25 14:57:24.966993 [ 6061 ] {abfdc400-0844-41a5-840e-ba1eded588ba} <Error> executeQuery: Code: 16. DB::Exception: There is no column default.dict1 in table. (NO_SUCH_COLUMN_IN_TABLE) (version 21.10.1.1) (from [::1]:55432) (in query: insert into t1(n) values ), Stack trace (when copying this message, always include the lines below):

0. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/exception:133: std::exception::capture() @ 0x137b2608 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
1. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/exception:111: std::exception::exception() @ 0x137b25d5 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x2453e123 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
3. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/Exception.cpp:57: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x137930d0 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
4. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Storages/ColumnsDescription.cpp:382: DB::ColumnsDescription::get(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0x1f448d1e in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
5. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/inplaceBlockConversions.cpp:69: DB::(anonymous namespace)::addDefaultRequiredExpressionsRecursively(DB::Block const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IDataType const>, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::IAST>, std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 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::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, bool) @ 0x1f1de521 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
6. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/inplaceBlockConversions.cpp:64: DB::(anonymous namespace)::addDefaultRequiredExpressionsRecursively(DB::Block const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IDataType const>, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::IAST>, std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 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::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, bool) @ 0x1f1de478 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
7. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/inplaceBlockConversions.cpp:83: DB::(anonymous namespace)::defaultRequiredExpressions(DB::Block const&, DB::NamesAndTypesList const&, DB::ColumnsDescription const&, bool) @ 0x1f1ddca0 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
8. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/inplaceBlockConversions.cpp:163: DB::evaluateMissingDefaults(DB::Block const&, DB::NamesAndTypesList const&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool, bool) @ 0x1f1dd9f5 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
9. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/addMissingDefaults.cpp:84: DB::addMissingDefaults(DB::Block const&, DB::NamesAndTypesList const&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool) @ 0x1f19469a in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
10. /home/avtokmakov/ch/ClickHouse/build_debug/../src/DataStreams/AddingDefaultBlockOutputStream.cpp:17: DB::AddingDefaultBlockOutputStream::AddingDefaultBlockOutputStream(std::__1::shared_ptr<DB::IBlockOutputStream> const&, DB::Block const&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool) @ 0x1eb4e7b9 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
11. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/memory:887: void std::__1::allocator<DB::AddingDefaultBlockOutputStream>::construct<DB::AddingDefaultBlockOutputStream, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&>(DB::AddingDefaultBlockOutputStream*, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb4ada1 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
12. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/__memory/allocator_traits.h:521: void std::__1::allocator_traits<std::__1::allocator<DB::AddingDefaultBlockOutputStream> >::__construct<DB::AddingDefaultBlockOutputStream, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&>(std::__1::integral_constant<bool, true>, std::__1::allocator<DB::AddingDefaultBlockOutputStream>&, DB::AddingDefaultBlockOutputStream*, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb4acdc in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
13. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/__memory/allocator_traits.h:482: void std::__1::allocator_traits<std::__1::allocator<DB::AddingDefaultBlockOutputStream> >::construct<DB::AddingDefaultBlockOutputStream, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&>(std::__1::allocator<DB::AddingDefaultBlockOutputStream>&, DB::AddingDefaultBlockOutputStream*, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb4aa3c in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
14. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/memory:2594: std::__1::__shared_ptr_emplace<DB::AddingDefaultBlockOutputStream, std::__1::allocator<DB::AddingDefaultBlockOutputStream> >::__shared_ptr_emplace<std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&>(std::__1::allocator<DB::AddingDefaultBlockOutputStream>, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb4a646 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
15. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/memory:3360: std::__1::shared_ptr<DB::AddingDefaultBlockOutputStream> std::__1::allocate_shared<DB::AddingDefaultBlockOutputStream, std::__1::allocator<DB::AddingDefaultBlockOutputStream>, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&, void>(std::__1::allocator<DB::AddingDefaultBlockOutputStream> const&, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb4a40a in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
16. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/memory:3369: std::__1::shared_ptr<DB::AddingDefaultBlockOutputStream> std::__1::make_shared<DB::AddingDefaultBlockOutputStream, std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>, bool&, void>(std::__1::shared_ptr<DB::IBlockOutputStream>&, DB::Block&, DB::ColumnsDescription const&, std::__1::shared_ptr<DB::Context const>&&, bool&) @ 0x1eb44fa5 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
17. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/InterpreterInsertQuery.cpp:293: DB::InterpreterInsertQuery::execute() @ 0x1eb423d0 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
18. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/executeQuery.cpp:573: DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1f1bd2a4 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
19. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/executeQuery.cpp:934: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1f1bb405 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
20. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Server/TCPHandler.cpp:291: DB::TCPHandler::runImpl() @ 0x1fd952a9 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
21. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Server/TCPHandler.cpp:1659: DB::TCPHandler::run() @ 0x1fda2928 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
22. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x24470a7c in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
23. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x24471304 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
24. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x245cb8c3 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
25. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x245c817d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
26. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x245c6f08 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
27. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
28. /build/glibc-YYA7BZ/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __clone @ 0x122103 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
```

`default.dict1` is not a column, it's dictionary name

#include "inplaceBlockConversions.h"
#include <Core/Block.h>
#include <Parsers/queryToString.h>
#include <Interpreters/TreeRewriter.h>
#include <Interpreters/ExpressionAnalyzer.h>
#include <Interpreters/ExpressionActions.h>
#include <Parsers/ASTExpressionList.h>
#include <Parsers/ASTWithAlias.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h>
#include <Parsers/ASTFunction.h>
#include <utility>
#include <DataTypes/DataTypesNumber.h>
#include <Interpreters/RequiredSourceColumnsVisitor.h>
#include <Common/checkStackSize.h>
#include <Storages/ColumnsDescription.h>
namespace DB
{
namespace
{
void addDefaultRequiredExpressionsRecursively(
    const Block & block, const String & required_column_name, DataTypePtr required_column_type,
    const ColumnsDescription & columns, ASTPtr default_expr_list_accum, NameSet & added_columns, bool null_as_default)
{
    checkStackSize();
    bool is_column_in_query = block.has(required_column_name);
    bool convert_null_to_default = false;
    if (is_column_in_query)
        convert_null_to_default = null_as_default && block.findByName(required_column_name)->type->isNullable() && !required_column_type->isNullable();
    if ((is_column_in_query && !convert_null_to_default) || added_columns.count(required_column_name))