```
CREATE TABLE test_01344 (x String, INDEX idx (x) TYPE set(10) GRANULARITY 1) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 0;

INSERT INTO test_01344 VALUES ('Hello, world');

SELECT NULL FROM test_01344 WHERE encrypt(ignore(encrypt(NULL, '0.0001048577', lcm(2, 65537), NULL, inf, NULL), lcm(-2, 1048575)), '-0.0000000001', lcm(NULL, NULL)) = NULL

2021.02.02 21:42:58.265823 [ 93 ] {2faa3ab2-400f-46bf-999f-1706f3ad3bf7} <Debug> default.test_01344 (da350dfe-27ef-4993-bd7d-40d758f03dd5) (SelectExecutor): Key condition: unknown
2021.02.02 21:42:58.271882 [ 93 ] {2faa3ab2-400f-46bf-999f-1706f3ad3bf7} <Fatal> : Logical error: 'ColumnUInt8 expected as Set index condition result.'.
2021.02.02 21:42:58.272837 [ 87 ] {} <Trace> BaseDaemon: Received signal 6
2021.02.02 21:42:58.273656 [ 166 ] {} <Fatal> BaseDaemon: ########################################
2021.02.02 21:42:58.273944 [ 166 ] {} <Fatal> BaseDaemon: (version 21.3.1.5893, build id: 62B0DA6CEA883383385566853BF173D5BB8388EB) (from thread 93) (query_id: 2faa3ab2-400f-46bf-999f-1706f3ad3bf7) Received signal Aborted (6)
2021.02.02 21:42:58.274156 [ 166 ] {} <Fatal> BaseDaemon: 
2021.02.02 21:42:58.274431 [ 166 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f45e490f18b 0x7f45e48ee859 0x10c78456 0x10c78513 0x1a93eb2a 0x1a907ae4 0x1a900f05 0x1a8fe167 0x1a8f7c05 0x1a56ef33 0x19daafd8 0x19da3b29 0x19da3106 0x1a08050a 0x1a080c7d 0x1a295354 0x1a293b0a 0x1abc2442 0x1abcde78 0x1e44a34c 0x1e44ab50 0x1e587bc3 0x1e584a4d 0x1e5838d8 0x7f45e4ac4609 0x7f45e49eb293
2021.02.02 21:42:58.274819 [ 166 ] {} <Fatal> BaseDaemon: 4. gsignal @ 0x4618b in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.02.02 21:42:58.275016 [ 166 ] {} <Fatal> BaseDaemon: 5. abort @ 0x25859 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.02.02 21:42:58.275394 [ 166 ] {} <Fatal> BaseDaemon: 6. ./obj-x86_64-linux-gnu/../src/Common/Exception.cpp:50: DB::handle_error_code(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x10c78456 in /workspace/clickhouse
2021.02.02 21:42:58.275838 [ 166 ] {} <Fatal> BaseDaemon: 7. ./obj-x86_64-linux-gnu/../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) @ 0x10c78513 in /workspace/clickhouse
2021.02.02 21:42:58.336714 [ 166 ] {} <Fatal> BaseDaemon: 8. ./obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeIndexSet.cpp:307: DB::MergeTreeIndexConditionSet::mayBeTrueOnGranule(std::__1::shared_ptr<DB::IMergeTreeIndexGranule>) const @ 0x1a93eb2a in /workspace/clickhouse
2021.02.02 21:42:58.398472 [ 166 ] {} <Fatal> BaseDaemon: 9. ./obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:1832: DB::MergeTreeDataSelectExecutor::filterMarksUsingIndex(std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::shared_ptr<DB::IMergeTreeIndexCondition>, std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::deque<DB::MarkRange, std::__1::allocator<DB::MarkRange> > const&, DB::Settings const&, DB::MergeTreeReaderSettings const&, Poco::Logger*) @ 0x1a907ae4 in /workspace/clickhouse
2021.02.02 21:42:58.459549 [ 166 ] {} <Fatal> BaseDaemon: 10. ./obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:641: DB::MergeTreeDataSelectExecutor::readFromParts(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >, 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 const&, DB::Context const&, unsigned long, unsigned int, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long, 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, long> > > const*) const::$_2::operator()(unsigned long) const @ 0x1a900f05 in /workspace/clickhouse
2021.02.02 21:42:58.520336 [ 166 ] {} <Fatal> BaseDaemon: 11. ./obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:665: DB::MergeTreeDataSelectExecutor::readFromParts(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >, 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 const&, DB::Context const&, unsigned long, unsigned int, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long, 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, long> > > const*) const @ 0x1a8fe167 in /workspace/clickhouse
2021.02.02 21:42:58.580975 [ 166 ] {} <Fatal> BaseDaemon: 12. ./obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:143: DB::MergeTreeDataSelectExecutor::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 const&, DB::Context const&, unsigned long, unsigned int, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long, 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, long> > > const*) const @ 0x1a8f7c05 in /workspace/clickhouse
2021.02.02 21:42:58.637650 [ 166 ] {} <Fatal> BaseDaemon: 13. ./obj-x86_64-linux-gnu/../src/Storages/StorageMergeTree.cpp:186: DB::StorageMergeTree::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&, DB::Context const&, DB::QueryProcessingStage::Enum, unsigned long, unsigned int) @ 0x1a56ef33 in /workspace/clickhouse
2021.02.02 21:42:58.687447 [ 141 ] {} <Trace> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Found 6 old parts to remove.
2021.02.02 21:42:58.687596 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_1_51_10
2021.02.02 21:42:58.688212 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_52_52_0
2021.02.02 21:42:58.688611 [ 166 ] {} <Fatal> BaseDaemon: 14. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:1606: DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPlan&, std::__1::shared_ptr<DB::PrewhereDAGInfo> const&, 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> > > > const&) @ 0x19daafd8 in /workspace/clickhouse
2021.02.02 21:42:58.688762 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_53_53_0
2021.02.02 21:42:58.689325 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_54_54_0
2021.02.02 21:42:58.689945 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_55_55_0
2021.02.02 21:42:58.690481 [ 141 ] {} <Debug> system.trace_log (d7ef83db-c77c-4e4f-b966-a71d93fdc998): Removing part from filesystem 202102_56_56_0
2021.02.02 21:42:58.739121 [ 166 ] {} <Fatal> BaseDaemon: 15. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:875: DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>) @ 0x19da3b29 in /workspace/clickhouse
2021.02.02 21:42:58.789877 [ 166 ] {} <Fatal> BaseDaemon: 16. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:524: DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0x19da3106 in /workspace/clickhouse
2021.02.02 21:42:58.841337 [ 166 ] {} <Fatal> BaseDaemon: 17. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:356: DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0x1a08050a in /workspace/clickhouse
2021.02.02 21:42:58.892830 [ 166 ] {} <Fatal> BaseDaemon: 18. ./obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:410: DB::InterpreterSelectWithUnionQuery::execute() @ 0x1a080c7d in /workspace/clickhouse
2021.02.02 21:42:58.947193 [ 166 ] {} <Fatal> BaseDaemon: 19. ./obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:541: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1a295354 in /workspace/clickhouse
2021.02.02 21:42:59.001112 [ 166 ] {} <Fatal> BaseDaemon: 20. ./obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:899: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1a293b0a in /workspace/clickhouse
2021.02.02 21:42:59.064333 [ 166 ] {} <Fatal> BaseDaemon: 21. ./obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:260: DB::TCPHandler::runImpl() @ 0x1abc2442 in /workspace/clickhouse
2021.02.02 21:42:59.099040 [ 106 ] {} <Trace> SystemLog (system.metric_log): Flushing system log, 8 entries to flush
2021.02.02 21:42:59.127897 [ 166 ] {} <Fatal> BaseDaemon: 22. ./obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:1417: DB::TCPHandler::run() @ 0x1abcde78 in /workspace/clickhouse
2021.02.02 21:42:59.200690 [ 166 ] {} <Fatal> BaseDaemon: 23. ./obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x1e44a34c in /workspace/clickhouse
2021.02.02 21:42:59.218935 [ 106 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 141.11 GiB.
2021.02.02 21:42:59.273575 [ 166 ] {} <Fatal> BaseDaemon: 24. ./obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerDispatcher.cpp:112: Poco::Net::TCPServerDispatcher::run() @ 0x1e44ab50 in /workspace/clickhouse
2021.02.02 21:42:59.292439 [ 106 ] {} <Trace> system.metric_log (ecd616bc-744a-4bd5-97b9-cf4ffefcc544): Renaming temporary part tmp_insert_202102_117_117_0 to 202102_117_117_0.
2021.02.02 21:42:59.312048 [ 106 ] {} <Trace> SystemLog (system.metric_log): Flushed system log
2021.02.02 21:42:59.346795 [ 166 ] {} <Fatal> BaseDaemon: 25. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x1e587bc3 in /workspace/clickhouse
2021.02.02 21:42:59.420365 [ 166 ] {} <Fatal> BaseDaemon: 26. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x1e584a4d in /workspace/clickhouse
2021.02.02 21:42:59.493833 [ 166 ] {} <Fatal> BaseDaemon: 27. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x1e5838d8 in /workspace/clickhouse
2021.02.02 21:42:59.494569 [ 166 ] {} <Fatal> BaseDaemon: 28. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
2021.02.02 21:42:59.495164 [ 166 ] {} <Fatal> BaseDaemon: 29. __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
2021.02.02 21:43:00.810615 [ 166 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: FD3D38968E4B5758B24042A02C10630B. There is no information about the reference checksum.
```
{
    return prev_reader ? prev_reader->isCurrentRangeFinished() : stream.isFinished();
}
MergeTreeRangeReader::ReadResult MergeTreeRangeReader::read(size_t max_rows, MarkRanges & ranges)
{
    if (max_rows == 0)
        throw Exception("Expected at least 1 row to read, got 0.", ErrorCodes::LOGICAL_ERROR);
    ReadResult read_result;
    if (prev_reader)
    {
        read_result = prev_reader->read(max_rows, ranges);
        size_t num_read_rows;
        Columns columns = continueReadingChain(read_result, num_read_rows);
        /// 
        if (read_result.num_rows == 0)
            return read_result;
        bool has_columns = false;
        for (auto & column : columns)
        {
            if (column)
                has_columns = true;
        }