```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.
{
        return std::make_shared<FunctionIn>();
    }
    String getName() const override
    {
        return name;
    }
    size_t getNumberOfArguments() const override
    {
        return 2;
    }
    
    
    
    
    bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
    DataTypePtr getReturnTypeImpl(const DataTypes & ) const override
    {
        return std::make_shared<DataTypeUInt8>();
    }
    bool useDefaultImplementationForConstants() const override
    {
        
        return !ignore_set;
    }
    bool useDefaultImplementationForNulls() const override { return null_is_skipped; }