**Describe the bug**
https://clickhouse-test-reports.s3.yandex.net/22945/abab3ba09fddc0c9a4e80f4b6789999606102fad/fuzzer_debug/server.log

**How to reproduce**
```
SELECT '21474836.48' = _table FROM merge(currentDatabase(), '') WHERE '102.3' IN (_table)
```

```
2021.04.12 12:58:13.427042 [ 196 ] {} <Fatal> BaseDaemon: 8. ./obj-x86_64-linux-gnu/../src/Interpreters/Context.cpp:2527: DB::Context::resolveStorageIDImpl(DB::StorageID, DB::Context::StorageNamespace, std::__1::optional<DB::Exception>*) const @ 0x1b1143d4 in /workspace/clickhouse
2021.04.12 12:58:14.351346 [ 196 ] {} <Fatal> BaseDaemon: 9. ./obj-x86_64-linux-gnu/../src/Interpreters/Context.cpp:2466: DB::Context::resolveStorageID(DB::StorageID, DB::Context::StorageNamespace) const @ 0x1b113ea8 in /workspace/clickhouse
2021.04.12 12:58:14.955178 [ 196 ] {} <Fatal> BaseDaemon: 10. ./obj-x86_64-linux-gnu/../src/Interpreters/ExpressionAnalyzer.cpp:344: DB::ExpressionAnalyzer::isPlainStorageSetInSubquery(std::__1::shared_ptr<DB::IAST> const&) @ 0x1b630b1e in /workspace/clickhouse
2021.04.12 12:58:15.554426 [ 196 ] {} <Fatal> BaseDaemon: 11. ./obj-x86_64-linux-gnu/../src/Interpreters/ExpressionAnalyzer.cpp:310: DB::ExpressionAnalyzer::tryMakeSetForIndexFromSubquery(std::__1::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&) @ 0x1b630510 in /workspace/clickhouse
2021.04.12 12:58:15.912327 [ 196 ] {} <Fatal> BaseDaemon: 12. ./obj-x86_64-linux-gnu/../src/Storages/VirtualColumnUtils.cpp:87: DB::(anonymous namespace)::buildSets(std::__1::shared_ptr<DB::IAST> const&, DB::ExpressionAnalyzer&) @ 0x1bfe2860 in /workspace/clickhouse
2021.04.12 12:58:16.267097 [ 196 ] {} <Fatal> BaseDaemon: 13. ./obj-x86_64-linux-gnu/../src/Storages/VirtualColumnUtils.cpp:181: DB::VirtualColumnUtils::filterBlockWithQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Block&, std::__1::shared_ptr<DB::Context>, std::__1::shared_ptr<DB::IAST>) @ 0x1bfe232a in /workspace/clickhouse
2021.04.12 12:58:16.876343 [ 196 ] {} <Fatal> BaseDaemon: 14. ./obj-x86_64-linux-gnu/../src/Storages/StorageMerge.cpp:481: DB::StorageMerge::getSelectedTables(DB::SelectQueryInfo const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Settings const&) const @ 0x1be9ece8 in /workspace/clickhouse
2021.04.12 12:58:17.484788 [ 196 ] {} <Fatal> BaseDaemon: 15. ./obj-x86_64-linux-gnu/../src/Storages/StorageMerge.cpp:254: DB::StorageMerge::read(std::__1::vector<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> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::SelectQueryInfo&, std::__1::shared_ptr<DB::Context>, DB::QueryProcessingStage::Enum, unsigned long, unsigned int) @ 0x1be9d8be in /workspace/clickhouse
2021.04.12 12:58:17.962450 [ 196 ] {} <Fatal> BaseDaemon: 16. ./obj-x86_64-linux-gnu/../src/Storages/IStorage.cpp:105: DB::IStorage::read(DB::QueryPlan&, std::__1::vector<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> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::SelectQueryInfo&, std::__1::shared_ptr<DB::Context>, DB::QueryProcessingStage::Enum, unsigned long, unsigned int) @ 0x1bdbf17d in /workspace/clickhouse
2021.04.12 12:58:18.907738 [ 196 ] {} <Fatal> BaseDaemon: 17. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:1723: DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPlan&) @ 0x1b39737d in /workspace/clickhouse
2021.04.12 12:58:19.890927 [ 196 ] {} <Fatal> BaseDaemon: 18. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:972: DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>) @ 0x1b38fe4e in /workspace/clickhouse
2021.04.12 12:58:20.869163 [ 196 ] {} <Fatal> BaseDaemon: 19. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:546: DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0x1b38ee86 in /workspace/clickhouse
2021.04.12 12:58:21.305332 [ 196 ] {} <Fatal> BaseDaemon: 20. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:245: DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0x1b94f3ea in /workspace/clickhouse
2021.04.12 12:58:21.727245 [ 196 ] {} <Fatal> BaseDaemon: 21. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:311: DB::InterpreterSelectWithUnionQuery::execute() @ 0x1b94fdad in /workspace/clickhouse
2021.04.12 12:58:22.267449 [ 196 ] {} <Fatal> BaseDaemon: 22. ./obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:561: DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1bb83229 in /workspace/clickhouse
2021.04.12 12:58:22.841805 [ 196 ] {} <Fatal> BaseDaemon: 23. ./obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:919: 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) @ 0x1bb813b5 in /workspace/clickhouse
2021.04.12 12:58:23.419246 [ 196 ] {} <Fatal> BaseDaemon: 24. ./obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:290: DB::TCPHandler::runImpl() @ 0x1c5ae8ad in /workspace/clickhouse
2021.04.12 12:58:24.032029 [ 196 ] {} <Fatal> BaseDaemon: 25. ./obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:1548: DB::TCPHandler::run() @ 0x1c5bb0c8 in /workspace/clickhouse
2021.04.12 12:58:24.093374 [ 196 ] {} <Fatal> BaseDaemon: 26. ./obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x2007606c in /workspace/clickhouse
2021.04.12 12:58:24.184877 [ 196 ] {} <Fatal> BaseDaemon: 27. ./obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerDispatcher.cpp:113: Poco::Net::TCPServerDispatcher::run() @ 0x20076870 in /workspace/clickhouse
2021.04.12 12:58:24.269738 [ 196 ] {} <Fatal> BaseDaemon: 28. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x201b3013 in /workspace/clickhouse
2021.04.12 12:58:24.349302 [ 196 ] {} <Fatal> BaseDaemon: 29. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x201afe9d in /workspace/clickhouse
2021.04.12 12:58:24.428390 [ 196 ] {} <Fatal> BaseDaemon: 30. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x201aed28 in /workspace/clickhouse
2021.04.12 12:58:24.428881 [ 196 ] {} <Fatal> BaseDaemon: 31. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.04.12 12:58:24.429261 [ 196 ] {} <Fatal> BaseDaemon: 32. __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
```

{
    auto name_deps = getDependentViewsByColumn(local_context);
    for (const auto & command : commands)
    {
        if (command.type != AlterCommand::Type::ADD_COLUMN && command.type != AlterCommand::Type::MODIFY_COLUMN
            && command.type != AlterCommand::Type::DROP_COLUMN && command.type != AlterCommand::Type::COMMENT_COLUMN)
            throw Exception(
                "Alter of type '" + alterTypeToString(command.type) + "' is not supported by storage " + getName(),
                ErrorCodes::NOT_IMPLEMENTED);
        if (command.type == AlterCommand::Type::DROP_COLUMN)
        {
            const auto & deps_mv = name_deps[command.column_name];
            if (!deps_mv.empty())
            {
                throw Exception(
                    "Trying to ALTER DROP column " + backQuoteIfNeed(command.column_name) + " which is referenced by materialized view "
                        + toString(deps_mv),
                    ErrorCodes::ALTER_OF_COLUMN_IS_FORBIDDEN);
            }
        }
    }
}
void StorageMerge::alter(