**Describe the bug**
1. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_ubsan/server.log
2. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_asan/server.log
3. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_msan/server.log
4. https://clickhouse-test-reports.s3.yandex.net/19736/342326978f2bb2fe5c108c2801cdbabaf407fa68/fuzzer_debug/server.log
5. https://clickhouse-test-reports.s3.yandex.net/19736/342326978f2bb2fe5c108c2801cdbabaf407fa68/fuzzer_tsan/server.log

CC @zhang2014 
* 2: the range contains elements not in the set
  */
BoolMask MergeTreeSetIndex::checkInRange(const std::vector<Range> & key_ranges, const DataTypes & data_types) const
{
    size_t tuple_size = indexes_mapping.size();
    ColumnsWithInfinity left_point;
    ColumnsWithInfinity right_point;
    left_point.reserve(tuple_size);
    right_point.reserve(tuple_size);
    for (size_t i = 0; i < tuple_size; ++i)
    {
        left_point.emplace_back(ordered_set[i]->cloneEmpty());
        right_point.emplace_back(ordered_set[i]->cloneEmpty());
    }
    bool invert_left_infinities = false;
    bool invert_right_infinities = false;
    for (size_t i = 0; i < tuple_size; ++i)
    {
        std::optional<Range> new_range = KeyCondition::applyMonotonicFunctionsChainToRange(
            key_ranges[indexes_mapping[i].key_index],
            indexes_mapping[i].functions,
            data_types[indexes_mapping[i].key_index]);
        if (!new_range)
            return {true, true};
        /** A range that ends in (x, y, ..., +inf) exclusive is the same as a range
          * that ends in (x, y, ..., -inf) inclusive and vice versa for the left bound.
          */
        if (new_range->left_bounded)
        {
            if (!new_range->left_included)