```sql
CREATE TABLE test(key Int32) ENGINE = MergeTree ORDER BY (key);
insert into test select intDiv(number,100) from numbers(10000000);
SELECT COUNT() FROM test WHERE key <= 100000 AND (NOT (toLowCardinality('') IN (SELECT '')));


<Fatal> BaseDaemon: ########################################
<Fatal> BaseDaemon: ########################################
<Fatal> BaseDaemon: ########################################
<Fatal> BaseDaemon: (version 22.8.11.15 (official build), build id: 8996F0B199922EB3) (from thread 3020
ey <= 100000 AND (NOT (toLowCardinality('') IN (SELECT '' ))) ;) Received signal Segmentation fault (11
<Fatal> BaseDaemon: (version 22.8.11.15 (official build), build id: 8996F0B199922EB3) (from thread 2281
y <= 100000 AND (NOT (toLowCardinality('') IN (SELECT '' ))) ;) Received signal Segmentation fault (11)
<Fatal> BaseDaemon: (version 22.8.11.15 (official build), build id: 8996F0B199922EB3) (from thread 2524
ey <= 100000 AND (NOT (toLowCardinality('') IN (SELECT '' ))) ;) Received signal Segmentation fault (11
<Fatal> BaseDaemon: Address: 0x7f32028fc000 Access: read. Attempted access has violated the permissions
<Fatal> BaseDaemon: Address: 0x7f324e218000 Access: read. Attempted access has violated the permissions
<Fatal> BaseDaemon: Address: 0x7f323d92a000 Access: read. Attempted access has violated the permissions
<Fatal> BaseDaemon: Stack trace: 0x14663831 0x1465cb43 0xcbaa3ce 0x13ceb847 0x13cec13d 0x13ced5e9 0x149
 0xa4be8bd 0x7f32a7232fa3 0x7f32a71634cf
<Fatal> BaseDaemon: Stack trace: 0x14663831 0x1465cb43 0xcbaa3ce 0x13ceb847 0x13cec13d 0x13ced5e9 0x149
 0xa4be8bd 0x7f32a7232fa3 0x7f32a71634cf
<Fatal> BaseDaemon: Stack trace: 0x14663831 0x1465cb43 0xcbaa3ce 0x13ceb847 0x13cec13d 0x13ced5e9 0x149
 0xa4be8bd 0x7f32a7232fa3 0x7f32a71634cf

```
found in 21.8 but I guess all versions are affected.

100% reproducible with 

```
clickhouse-benchmark <<< "SELECT COUNT() FROM test WHERE key <= 100000 AND (NOT (toLowCardinality('') IN (SELECT '')))"
```

22.12.1.985 returns random results, so I guess it's affected as well.
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & ) const override { return false; }
    ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, [[maybe_unused]] size_t input_rows_count) const override
    {
        if constexpr (ignore_set)
            return ColumnUInt8::create(input_rows_count, 0u);
        
        ColumnPtr column_set_ptr = arguments[1].column;
        const ColumnSet * column_set = checkAndGetColumnConstData<const ColumnSet>(column_set_ptr.get());
        if (!column_set)
            column_set = checkAndGetColumn<const ColumnSet>(column_set_ptr.get());
        if (!column_set)
            throw Exception("Second argument for function '" + getName() + "' must be Set; found " + column_set_ptr->getName(),
                ErrorCodes::ILLEGAL_COLUMN);
        ColumnsWithTypeAndName columns_of_key_columns;
        
        const ColumnWithTypeAndName & left_arg = arguments[0];
        const ColumnTuple * tuple = typeid_cast<const ColumnTuple *>(left_arg.column.get());
        const ColumnConst * const_tuple = checkAndGetColumnConst<ColumnTuple>(left_arg.column.get());
        const DataTypeTuple * type_tuple = typeid_cast<const DataTypeTuple *>(left_arg.type.get());
        ColumnPtr materialized_tuple;
        if (const_tuple)
        {
            materialized_tuple = const_tuple->convertToFullColumn();
            tuple = typeid_cast<const ColumnTuple *>(materialized_tuple.get());
        }
        auto set = column_set->getData();
        auto set_types = set->getDataTypes();
        if (tuple && set_types.size() != 1 && set_types.size() == tuple->tupleSize())
        {
            const auto & tuple_columns = tuple->getColumns();